title: Windows Batch File - Net Use encounter "System Error 64"
body: <p>Been encountering this error "System error 64 - the specified network name is no longer available" in one of my windows batch script while trying to NET USE \server\drive\folder to connect to a network folder.</p>
  
  <p>However, when I re-run the script, the Net Use command executed successfully and is able to map to the network folder. These issue seems to happen only on the first run, as subsequent re-run were able to complete successfully.</p>
  
  <p>The code that cause the err:</p>
  
  <pre><code>net use \\qserver\adrive\RAG\SQR /persistent:yes System error 64 has occurred.
  
  The specified network name is no longer available.
  </code></pre>
  
  <p>Anyone has any idea why this is happening? Seems like 1st run of script failed but subsequent runs are able to complete successfully.</p>
  
  <p>In addition, was wondering if there are any err handling techniques that can detect this err and use some scripting to force a re-run.</p>
  
  <p>Something like: </p>
  
  <pre><code>IF (System Error 64 occurred) {
  //Do a re-run 
  net use \\qserver\adrive\RAG\SQR /persistent:yes 
  }
  </code></pre>
  
  <p>Thanks a lot for the help. Pls advise based on above!</p>