Task to start a batch file for registration of DLL, everything works on the computer under the admin.
But if you run on another computer under the user writes
“Invalidly specified folder name”
Created account specifically for these needs with admin rights
process pr = new process ();
pr.startinfo.useshellexecute = false;
pr.startinfo.filename = @ "C: \ users \" + username + @ "\ documents \ dll2.bat";
pr.startinfo.verb = "runas";
pr.startinfo.username = "admin";
pr.startInfo.domain = "OS";
PR.StartInfo.password = "Password";
pr.start ();
tried to run and so “C: \ DLL2.BAT” – the error is the same.
Answer 1
Added a line and the problem disappeared
pr.startInfo.workingDirectory = Path.getDirectoryName (@ “C: \ Windows \ System32 \ cmd.exe”);