c# - Local Service not calling .exe under different user account -


i have service installed "system" calls process need run user.

try {     system.security.securestring sspwd = new system.security.securestring();     system.diagnostics.processstartinfo proc = new system.diagnostics.processstartinfo();     proc.useshellexecute = false;     proc.verb = "runas";     proc.username = "stevie";     string p = "stevie";     (int x = 0; x < p.length; x++)     {         sspwd.appendchar(p[x]);     }      proc.password = sspwd;     proc.filename = @"c:\dailytask\genfile.exe";     proc.arguments = "-csv";     system.diagnostics.process.start(proc); } catch(exception errrr) {     m.log(errrr.tostring());    } 

i used procmon see if runs under different user won't kick off following error.

sunday, january 24, 2016 --- system.componentmodel.win32exception (0x80004005):access denied @ system.diagnostics.process.startwithcreateprocess(processstartinfo startinfo) @ system.diagnostics.process.start() @ system.diagnostics.process.start(processstartinfo startinfo) @ directorywatcher.myposystemwatcher.open_f(string filepath) 

i have complete rights directory , contents. have shared out "everyone" , given read/write access.

not sure else missing. able manually run process out errors.


Comments