title: c# open cmd.exe process and Execute multiple commands
body: <p>I would like to be able to open cmd and execute two commands from the window. First I would like to navigate to a particular directory where I can then run the second command from. Running a single command is pretty easy as this is all I have to do:</p>
  
  <pre><code>string path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Cisco Systems\VPN Client\";
  
          Process process = new Process();
  
          ProcessStartInfo processInfo = new ProcessStartInfo("cmd.exe", @"/c cd " + path );
  
          process.StartInfo = processInfo;
  
          process.Start();
  </code></pre>
  
  <p>However am not sure of the way to add the second argument so it runs after cmd runs the first command. Some research led me to this code snippet. Am unsure if this works since my aim is to start cisco vpn client from cmd and this seems not to start it. Here is the code:</p>
  
  <pre><code>string path = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) + @"\Cisco Systems\VPN Client\";
  
          Process process = new Process();
  
          ProcessStartInfo processInfo = new ProcessStartInfo("cmd.exe", @"/c cd " + path + "-t vpnclient connect user validuser pwd validpassword nocertpwd validconnectionentry ");
  
          process.StartInfo = processInfo;
  
          process.Start();
  </code></pre>
  
  <p>I once started the vpn client from cmd with the credentials just to make sure they were valid and it worked but I cant pull it off via C# programmatically.</p>
  
  <p>Regards.</p>