Re: CreateProcess not working as doc specifies.
- From: Walter Briscoe <wbriscoe@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 14 Jun 2005 08:09:18 +0000
In message <5EAB7DEB-B0F9-47D3-8CA7-D64844A1218C@xxxxxxxxxxxxx> of Mon, 13 Jun 2005 13:50:17 in microsoft.public.win32.programmer.kernel, David Bennion <David@Bennion.?.microsoft.com.invalid> writes
I am having some difficulty using CreateProcess() to run a batch file and get the same return code as I get from the command shell. I am trying to run the batch in the manner suggested by the CreateProcess documentation, but it fails to run.
URL? or quotation.
I am posting all of the background information below (sorry if the wordwrap from the post obfuscates anything):
Snippet of doc from CreateProcess() msdn doc: -------------------------------------------------------- "To run a batch file, you must start the command interpreter; set lpApplicationName to cmd.exe and set lpCommandLine to the name of the batch file."
[snipped code]
Tried your code in Visual C++ 6.0 SP 5 on Windows 2000 Professional SP4.
I snip my results:
// OK if(CreateProcess("C:\\winnt\\system32\\cmd.exe", "/C C:\\DOCUME~1\\ADMINI~1.BRI\\LOCALS~1\\Temp\\david\\t.bat",
// US if(CreateProcess("cmd.exe", "/C C:\\DOCUME~1\\ADMINI~1.BRI\\LOCALS~1\\Temp\\david\\t.bat",
// OK if(CreateProcess("C:\\winnt\\system32\\cmd.exe", "/C t.bat",
// US if(CreateProcess("C:\\winnt\\system32\\cmd.exe", "t.bat",
// OK if(CreateProcess(0, "t.bat",MSDN says about lpApplicationName: "will not use the search path". Does this meet your need? -- Walter Briscoe .
- Follow-Ups:
- Re: CreateProcess not working as doc specifies.
- From: David Bennion
- Re: CreateProcess not working as doc specifies.
- References:
- CreateProcess not working as doc specifies.
- From: David Bennion
- CreateProcess not working as doc specifies.
- Prev by Date: Re: how to implement Thread Local Storage (TLS) in kernel
- Next by Date: open up a hidden partition
- Previous by thread: CreateProcess not working as doc specifies.
- Next by thread: Re: CreateProcess not working as doc specifies.
- Index(es):
Relevant Pages
|