M
Matt
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
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