title: acessing network shared folder with a username and password string in vb.net
body: <p>i am using the following code to read the details from a network folder which is restricted for only one user</p>
  
  <pre><code>shell("net use q: \\serveryname\foldername /user:admin pwrd", AppWinStyle.Hide, True, 10000)
              Process.Start(path)
  shell("net use q: /delete")
  </code></pre>
  
  <p>when i run this to open any pdf or jpg or any other files except word/excel/powerpoint, everything is working fine. but the problem comes only when i access a word file.</p>
  
  <p>in the step one, i am giving permission to access the word file.
  in the step two, word file is open.
  in the third, i am deleting the q drive.</p>
  
  <p>the problem is the word file is still open. so i am getting a dos window, saying that "some connections of still connected or searching some folders, do you want to force disconnect"
  please help.... how to access a word file (editable files) providing user name and password from the code and at the same time he shoud not have access to any other folders directly. </p>