title: Net use works in batch file, fails in script
body: <p>We are a small office with a Linux appliance server (SAMBA) and Win7HP on the desktops. We have one machine that acts as a "backup server" and backs up the server nightly.</p>
  
  <p>Writing what was supposed to be a quick &amp; dirty addition to the backup script that would loop like this:</p>
  
  <pre><code>a. net use * /d /y
  b. net use u: \\ourserver\userNN /u:userNN password
  c. run sync util to sync u: to this user's storage space on backup server
  d. repeat
  </code></pre>
  
  <p>If I manually create the above in a batch file, everything works fine. (However, for many reasons the procedure must be automated and tied into our existing backup scripts.)</p>
  
  <p>If a script creates the identical batch file and runs it, the first user is logged-in and syncronized, but all subsequent <code>net use</code> attempts fail.</p>
  
  <p>Similarly, if the script attempts to map the drive through code, this message is received:</p>
  
  <p><code>Unrecognised network error #183</code></p>
  
  <p>The above error suggests that the network drive/path is unavailable -- but a net use command typed at the command line using identical parameters is successful.</p>
  
  <p>The "backup server" is a Win7HP box with UAC disabled. When cmd prompt is launched, all windows are preceded by the word: <code>Administrator:</code> -- however, when the script launches a command window to net use the drive, the cmd titlebar lacks that prefix.</p>
  
  <p>Any thoughts / ideas?</p>