murrayju / CreateProcessAsUser

Creates a process in a different Windows session
MIT License
369 stars 114 forks source link

Start process with parameters #19

Closed AccRPA closed 6 years ago

AccRPA commented 7 years ago

Hi!, thank you for the code, is awesome. I would like to pass some parameters to a process (.exe) that I invoke with StartProcessAsCurrentUser function. Do you know how to pass parameters to a program with that function?

Thanks a lot.

AndrewSav commented 7 years ago

@AccRPA The usual way I presume. What did you try?

AccRPA commented 7 years ago

Hi!, thank you. I finally I did it! I pass the parameters in the cmdLine parameter, but if I pass two parameters ("p1 p2") the only parameter that the program receive (arg[0]) is p2, I don't know why. So the solution is pass the parameters with a blank space before: cmdLine = " p1 p2". Also I found this useful link

Thanks, regards.

murrayju commented 6 years ago

Thanks @AccRPA, I added your findings to the readme.