Trouble with "Process's" please help!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

.



Relevant Pages

  • Re: Moving command.com out of system32 directory
    ... > What is the rationale for moving the dos command shell out ... system commands on your system if they know or can guess the location of the ... [CMD.EXE is the DOS shell that comes with Windows ...
    (microsoft.public.inetserver.iis.security)
  • Re: KfW unattended access using keytab
    ... All builds are started from either a DOS command shell and batch files or ... A few questions related to using kinit with a keytab file.... ... If only command line tools are used, is there ... are unattended a Windows popup can cause problems, ...
    (comp.protocols.kerberos)
  • Re: Trouble with "Processs" please help!
    ... Dim StartInfo As New ProcessStartInfo ... The oddest thing is happening given the following piece ... Dim CMDProcess As Process = New Process ... the command will not work. ...
    (microsoft.public.dotnet.languages.vb)