title: Open remote shared folder with credentials
body: <p>I need to open a folder on a remote server with different credentials in a window (explorer.exe).</p>
  
  <p>I managed to do it with no credentials (my credentials), but when I do it with another username and another password than mine, it opens a prompt to enter a username and a password, and it says "access denied".</p>
  
  <p>In the access log on the remote desktop, it says that I tried to connect with my own username, and not the other username I entered. So, the process obviously did not work.</p>
  
  <p>But, I can't figure out why. My code is as follows:</p>
  
  <pre><code>Dim domain, username, passwordStr, remoteServerName As String
  Dim password As New Security.SecureString
  Dim command As New Process
  
  domain = "domain.com"
  username = "username"
  passwordStr = "password"
  remoteServerName = "serverName"
  
  For Each c As Char In passwordStr.ToCharArray
      password.AppendChar(c)
  Next
  
  
  command.StartInfo.FileName = "explorer.exe"
  command.StartInfo.Arguments = "\\" &amp; serverName &amp; "\admin$\Temp"
  
  command.StartInfo.UserName = username
  command.StartInfo.Password = password
  command.StartInfo.Domain = domain
  command.StartInfo.Verb = "open"
  command.StartInfo.UseShellExecute = False
  
  command.Start()
  </code></pre>