I am trying to send a command to the external command line (cmd.exe) from the Windows form application that I'm writing in VB.NET (using VS2008).
I can only access the external program thru the command line (its not my program) and I must do so from a form app.
I am trying to use the following code. I am able to call a cmd.exe window, but I can't pass the command line my command.
Using mp As New Process
With mp.StartInfo
.FileName = "cmd.exe"
.UseShellExecute = False
.CreateNoWindow = False
.RedirectStandardInput = True
.RedirectStandardInput = True
End With
mp.Start()
mp.StandardInput.WriteLine(p)
Debug.WriteLine(p)
mp.WaitForExit()
mp.Close()
End Using
The command that I'm attempting to pass requires nested quotes. I believe the syntax is correct. However, at the moment, I can't pass anything to the command line to verify whether or not the command is syntactically correct. The command follows:
Dim p As String = Chr(34) & "C:\Program Files\proeWildfire 4.0\bin\proe.exe" & Chr(34) & " -g:no_graphics -i:rpc_input +batchedrw " & Chr(34) & "+input=L:\MechEng\Pro_E\Work_Order\W026637\tank_shell_master.asm.130" & Chr(34) & " " & Chr(34) & "+output=C:\Users\Rob Frei\Desktop\tank_shell_master.easm" & Chr(34) & " +measure"
What am I doing wrong?
Thx.