CreateProcess problem.
-
Hi all. I have problem new create process. I must set paramets in command line wen I create process. and I dont know, how to do this. can help?
-
Hi all. I have problem new create process. I must set paramets in command line wen I create process. and I dont know, how to do this. can help?
Try the following:
CString strExeAndParams = _T("\"C:\\MyExe.exe\" Param1 Param2");
BOOL bOK = CreateProcess(NULL, (TCHAR*)(LPCTSTR)strExeAndParams, ...);Note that the path to the executable is wrapped with \" - because if the path has as space in it (like in "Program Files"), Windows will interpret the first half as the EXE name and the second half as the first command-line parameter. Hope this helps ...
-
Try the following:
CString strExeAndParams = _T("\"C:\\MyExe.exe\" Param1 Param2");
BOOL bOK = CreateProcess(NULL, (TCHAR*)(LPCTSTR)strExeAndParams, ...);Note that the path to the executable is wrapped with \" - because if the path has as space in it (like in "Program Files"), Windows will interpret the first half as the EXE name and the second half as the first command-line parameter. Hope this helps ...
Thanks it help.