Windows API - CreateProcess() path with space

前端 未结 5 1965
春和景丽
春和景丽 2021-01-11 13:57

How do I pass path with space to the CreateProcess() function?

The following works

STARTUPINFO si;
            PROCESS_INFORMATION pi;

            Z         


        
5条回答
  •  难免孤独
    2021-01-11 13:59

    You don't need to specify the application path in both the first and second arguments. According to the MSDN documentation the second argument should be only command line arguments if you list the application name in the first argument. Otherwise, set the first argument to NULL and then in the second argument enclose the application name in quotes if it contains a space. Not sure why your last listing doesn't work.

提交回复
热议问题