murrayju / CreateProcessAsUser

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

Run Proccess with arguments #6

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi, can you tell me how I can run Process with arguments?? I want run process under windows service, this process is WinForm and in Program.cs i use string[] args and set few options and when I example use s / stream ex. PrGP.exe -s then I want run one window in this program, when I use k / kurs ex. PrGP.exe -k then I want run different window in this program. When I use normal cmd then is ok, but when I try use your class like: ProcessExtensions.StartProcessAsCurrentUser("C:\OK\PrGP.exe", "-s") then this dont works :( im trying too like this ProcessExtensions.StartProcessAsCurrentUser("cmd", string.Format("{0} -s", "C:\OK\PrGP.exe")) and too dont work. Link to class -> https://github.com/murrayju/CreateProcessAsUser now class Program in program where I choose windows looks like that http://screenshooter.net/102681996/xmmaqgr and here I try run like this: screenshooter.net/102681996/yrgurgq

ok problem solved, I had an error in the path of the setup program :)