CreateProcess doesn't pass command line arguments

前端 未结 8 2174
梦谈多话
梦谈多话 2020-12-01 10:20

Hello I have the following code but it isn\'t working as expected, can\'t figure out what the problem is.

Basically, I\'m executing a process (a .NET process) and pa

8条回答
  •  盖世英雄少女心
    2020-12-01 11:22

    You can add a space as first character of the cmdArgs string:

    LPTSTR cmdArgs = " name@example.com";

    Apparently Windows appends the 2nd argument string to the application name represented by the first argument, and the result is passed as command line arguments to the executable. So adding a space will properly separate the arguments.

提交回复
热议问题