LogicAssault
New member
- Joined
- Apr 30, 2006
- Messages
- 2
- Programming Experience
- Beginner
How can i start a proccess and pass it parameters? What i have does not seem to be working.
VB.NET:
Dim myProcess As Process = New Process()
' Create the start info
'
myProcess.StartInfo.FileName = System.AppDomain.CurrentDomain.BaseDirectory() + "e_wise\e_wise_w.exe"
myProcess.StartInfo.Arguments = ControlChars.Quote + SelectFileDialog1.FileName + ControlChars.Quote + " " + ControlChars.Quote + System.AppDomain.CurrentDomain.BaseDirectory() + ControlChars.Quote
'
' Start the process in a hidden window.
'
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
myProcess.StartInfo.CreateNoWindow = True
myProcess.Start()
'
' Kill the process if it doesn't finish in one minute.
'
myProcess.WaitForExit(1000)
If Not myProcess.HasExited Then
myProcess.Kill()
End If
'
' Show the results.
'
MessageBox.Show("The window was " & _
"closed at: " & myProcess.ExitTime & ". With Exit code: " & "Exit Code: " & myProcess.ExitCode)
myProcess.Close()