Home > Software engineering >  CreateProcess invocation path have Spaces, and "
CreateProcess invocation path have Spaces, and "

Time:02-24

Unicode, call the CreateProcess, if there are no Spaces can be an executable file path, the space will prompt "not internal or external command, not can run the program or batch file",
Baidu said path have Spaces with double quotes, also have to say to want to add terminator, all but also useless,
 
STARTUPINFO si={0};
Si. Cb=sizeof (STARTUPINFO);
ZeroMemory (& amp; Si, sizeof (si));
Si. HStdError=hPipeWrite;
Si. HStdOutput=hPipeWrite;
Si. DwFlags=STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
Si. WShowWindow=SW_HIDE;//SW_SHOW;

PROCESS_INFORMATION PI={0};
ZeroMemory (& amp; PI, sizeof (PI));

Cstrings szDest=_T (" \ "") + sCmdText + _T (" \ " 0 ");
Cstrings hebing=szDest + _T (" ") + parameter;
BOOL bProcess=CreateProcess (NULL, LPWSTR hebing (LPCTSTR), NULL, NULL, TRUE, 0, NULL, NULL, & amp; Si, & amp; PI);

CodePudding user response:

You print hebing, format should be wrong
  • Related