Aug 10, 2013 at 4:16pm UTC
This doesn't work... because there is a space in the name of the .exe ;/
CreateProcessW(L"test lol.exe" , NULL , NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi);
This works however...
CreateProcessW(L"testlol.exe" , NULL , NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi);
But how can I get it working when there is a space in the file name?:O
Last edited on Aug 10, 2013 at 4:17pm UTC
Aug 10, 2013 at 4:45pm UTC
Use double quotes in file name, see PathQuoteSpaces() API or write your own routine.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773739(v=vs.85).aspx
If you insist on using a literal string, then escape it like this:
CreateProcessW(L"\"test lol.exe\"", NULL , NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi);
Last edited on Aug 10, 2013 at 4:48pm UTC
Aug 10, 2013 at 5:11pm UTC
CreateProcessW(L"\"test lol.exe\"" , NULL , NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi);
Doesn't seem to be working. :(
Aug 10, 2013 at 7:22pm UTC
I have no clue why but I probably screwed up pretty bad somewhere..
Passing like this should just work:
CreateProcessW(L"test lol.exe" , NULL , NULL, NULL, FALSE, NULL, NULL, NULL, &si, &pi);