rc = CreateProcessA("cmd.exe",...
last error is 2
ERROR_FILE_NOT_FOUND
In other words, you have to use something like "c:\windows\system32\cmd.exe" (or first call a function which searches the path for the executable :-) )
I found that I needed to
add "c:" before the "/c".
Any idea what that is about?
I don't see it mentioned in "cmd /?" nor the CreateProcess()
documentation.
Because argv[0] is the module name, C programmers generally ***repeat the module name as the first token in the command line***.
Thanks Rudy!
But it seems to me that this is quite misleading:...
It doesn't suggest that you're supposed to put something
before the "/c" as mentioned elsewhere.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 183 |
Nodes: | 16 (1 / 15) |
Uptime: | 15:57:04 |
Calls: | 3,594 |
Calls today: | 3 |
Files: | 11,139 |
Messages: | 3,441,065 |