I am confused by the first 2 params, module and command-line. I find unless I populate both it doesn’t work right, and it seems the documentation says otherwise.
I want to call “testApp.exe param1=123”
The only way I found that works is:
CreateProcess("testApp.exe","testApp.exe param1=123",...
I thought either of these should work, but no luck so far:
CreateProcess("testApp.exe","param1=123",...
CreateProcess(NULL,"testApp.exe param1=123",...
I’ve read the msdn docs a few times so what am I missing?
The first parameter is the name of the executable to run. The second parameter is the command line. The command-line need not contain the name of the executable, if it doesn’t however and you pass something like
then in your program,
argv[0] == "param1"andargv[1] == "param2". Therefore, you usually have to pass the name of the executable as the first value to satisfy the program’s requirements, not Windows’.If you do not pass the executable name, it is extracted from the first value in the command line string.