title: Execute CMD Command from vb.net
body: <p>Hi I want to start a program from my vb.net app. </p>
  
  <p>The problem I have, are spaces in the commant. 
  My code looks like this :</p>
  
  <pre><code>Dim p As New Process
  Dim pi As ProcessStartInfo = New ProcessStartInfo()
  execute = generateStatement(project)
  pi.FileName = "cmd.exe"
  pi.UseShellExecute = False
  pi.RedirectStandardOutput = True
  pi.Arguments = "/K " + execute
  p.StartInfo = pi
  p.Start()
  </code></pre>
  
  <blockquote>
    <p>execute = "C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE" 
    cmd Output =  'C:\Program' is not reconized as internal or external command </p>
  </blockquote>
  
  <p>then I tried to put Quotes ( add Char 34 ) befor and afer the string like this : </p>
  
  <blockquote>
    <p>execute = ""C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE""</p>
  </blockquote>
  
  <p>still same cmd output. 
  So i tried the command via Shell, still same problem.</p>
  
  <p>Can someone tell me how I can pass a consol command with spaces in it ? 
  Change dir is no option, I have to put some more directories in the command.</p>