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: | 379 |
Nodes: | 16 (2 / 14) |
Uptime: | 42:17:45 |
Calls: | 8,141 |
Calls today: | 4 |
Files: | 13,085 |
Messages: | 5,857,793 |