I checked my process start program and the only difference I an see that I
have and you have is the
Dim of the Processes in the begining. This works for me... dont know if you
want to see if it works for u.
my code is as follows:
Dim StartInfo As New ProcessStartInfo()
Dim myNewApp As New Process()
myNewApp.StartInfo.FileName = "C:\FILENAME.EXE"
myNewApp.StartInfo.Arguments = "/Q"
myNewApp.StartInfo.WorkingDirectory = "C:\Temp"
myNewApp.StartInfo.WindowStyle = ProcessWindowStyle.Normal
myNewApp.Start()
Miro
"Matt" <Kr****@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Ok so I'm trying to run a simple dos command shell through a VB.NET
2005 program. The oddest thing is happening given the following piece
of code:
'================================================= ===========
'=== VARIABLE DECLARATION AND INITIALIZATION ================
'================================================= ===========
'---General Variables------------------------------------
Dim CMDProcess As Process = New Process
'---End General Variables--------------------------------
'---XLNT Shell Variables---------------------------------
CMDProcess.StartInfo.FileName = "cmd.exe"
CMDProcess.StartInfo.Arguments = "\c md C:\temp\temp"
'---End XLNT Shell Variables-----------------------------
'================================================= ===========
'=== END VARIABLE DECLARATION AND INITIALIZATION ============
'================================================= ===========
'================================================= ===========
'=== EXECUTE JOB AND KEEP TRACK OF TIME =====================
'================================================= ===========
CMDProcess.Start() <--- Does not work
Process.Start("cmd.exe", "/c md C:\temp\temp") <---- Works
If I create a new instance of the "Process" object and then try to
start it, the command will not work. But if I just simply call
Process.start the command works!
I need to be able to use the created object to do this job. If anyone
could offer any thoughts I would be very appreciative.
Thanks
Matt