title: NET USE command to connect to a shared folder on local LAN
body: <p>I am trying to write a batch file to connect to a shared folder on my LAN.</p>
  
  <p>The command reads:</p>
  
  <pre><code>net use s: \\&lt;server add&gt;\sharename /user:username
  </code></pre>
  
  <p>How do I include the password in the command as well?</p>
  
  <p>I've tried: </p>
  
  <p><code>net use s: \\&lt;server add&gt;\sharename /user:username password</code> </p>
  
  <p>and get an incorrect syntax error.</p>
  
  <pre><code>The syntax of this command is:
  
  NET USE
  [devicename | *] [\\computername\sharename[\volume] [password | *]]
          [/USER:[domainname\]username]
          [/USER:[dotted domain name\]username]
          [/USER:[username@dotted domain name]
          [/SMARTCARD]
          [/SAVECRED]
          [[/DELETE] | [/PERSISTENT:{YES | NO}]]
  
  NET USE {devicename | *} [password | *] /HOME
  
  NET USE [/PERSISTENT:{YES | NO}]
  </code></pre>
  
  <p>This is all SOHO so assume no Server on network.  I am using a windows 7 client.</p>