title: Command not executing when invoking windows cmd from vb.net app
body: <p>I'm a bit of a .NET noob. I've been struggling trying to find a way to execute a command through a vb.net application and I found <a href="http://social.msdn.microsoft.com/Forums/vstudio/en-US/c88f61f5-7f2b-4c9b-8523-a334186fb0b9/how-to-execute-a-command-line-in-vbnet" rel="nofollow">this thread</a>
  so what I came up with, to map a drive to another server on the network was this;</p>
  
  <pre><code>Dim application As New ProcessStartInfo("cmd.exe")
  Dim process As Process
  process = process.Start(application)
  Dim command As String = "net use x: \\webtest01\c$ /USER:daylight\robbery TakeItNGo" 'all fake obviously
  process.StandardInput.WriteLine(command)
  process.WaitForExit()
  process.Close()
  </code></pre>
  
  <p>but when I run app, it sits for about 30seconds and then I get the windows command console popping up with the working directory set to <code>E:\&gt;</code></p>
  
  <p>can someone tell me what I'm doing wrong please, this is the first time I'm doing this from a vb.net app</p>