title: IIS is unable to run "net use" command in a batch file
body: <p>We have a CMS application that used to be able to run all the commands in a batch file; however, it has been failing in the last week. </p>
  
  <p>For testing, we have modified the contents in the batch file like this:</p>
  
  <pre><code>echo starting &gt; c:\log.txt
  whoami &gt;&gt; c:\log.txt
  net use Z:\ \\192.168.2.123\share\ password /user:userWithAdminRightsInTarget    
  copy c:\aTestFile.txt Z:\Success.txt
  net use Z:/DELETE
  </code></pre>
  
  <p>Let's say ComputerSource is the computer where IIS is hosting the CMS website and where the batch file resides, and ComputerTarget is the computer where I want to copy the files to.</p>
  
  <p>If I run the batch file manually by double clicking it, all commands are run successfully; the result of whoami in c:\log.txt displays the user account that is logged into the server, and the file is copied successfully.</p>
  
  <p>However, if I run the batch file from the CMS website, it executes the first line "echo starting > c:\log.txt" but fails afterwards. </p>
  
  <p>Both commputers are part of a domain
  We have tested the application by using different domain names, even domain admin accounts.
  We have used impersonation in the website (specified in web.config file of cms website) as well as using domain admin accounts in IIS directory security. 
  The result of the whoami command when the batch file is run from the website is nt/network service. We have practically tried almost anything.</p>
  
  <p>We will really appreciate for any insights and help that anyone can provide.</p>
  
  <p>Thank you.</p>