I have a question regarding a symptom of my misuse of CreateProcess. I\'m using the lpcommandline parameter to feed the path to my executable and parameters. My misuse is t
As the document Martin York linked to hinted, CreateProcess() has some behaviour for back-compat with pre-long-name programs.
"c:\program files\sub dir\program name arg1 arg2" will look for:
"c:\program.exe" files\sub dir\program name arg1 arg2 "c:\program files\sub.exe" dir\program name arg1 arg2 "c:\program files\sub dir\program.exe" name arg1 arg2 "c:\program files\sub dir\program name.exe" arg1 arg2
So if any of these files exist, Windows will to call them, not your program. Also, I would assume if you did not have read access to any of the folders these possible matches are in, CreateProcess() may fail out immediatly, instead of checking if you have read to the later possible matches. (Windows by default checks read access only the final folder.)