title: Jenkins: Masking Password for Web Deploy Batch Commands
body: <p>Instead of hard coding my password onto the batch command window, I want to use tools to hide my credentials.  </p>
  
  <p>Credentials work properly when hard coded but I am receiving this error when trying to mas my password using, "Mask password and regexes" and "Use secret test(s) or file(s)" Secret text:
  <a href="https://i.stack.imgur.com/zHePy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zHePy.png" alt="Masking and Expressions"></a>
  <a href="https://i.stack.imgur.com/ycIM2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ycIM2.jpg" alt="Secret text"></a></p>
  
  <pre><code>Error: The remote server returned an error: (401) Unauthorized.
  </code></pre>
  
  <p>My password is masked properly on the batch command:</p>
  
  <pre><code>C:/"Program Files (x86)/IIS/Microsoft Web Deploy V3/msdeploy.exe" -verb:sync -source:package="webApp1/webApp1/obj/DEBUG/_PublishedWebsites/webApp1_Package/webApp1.zip" -dest:auto,computerName=https://MYCIServer:8172/msdeploy.axd,username=DOMAIN\UserName,password=IIS_Pass,authType=basic -allowUntrusted
  </code></pre>
  
  <p>Here's how it appears on the logs:</p>
  
  <pre><code>username=DOMAIN\UserName,password=************,authType=basic
  </code></pre>
  
  <p>Does "Mask passwords and regexes (and enable global passwords), Inject passwords to the build as environment variables or Use secret text(s) or file(s)" work with Batch Commands? If yes, please provide me with the steps you went through to get this to work.</p>