Start Process with administrator right in C#

DomBer picture DomBer · Nov 5, 2010 · Viewed 35.4k times · Source

I have to start a command line program with System.Diagnostics.Process.Start() and run it as Administrator.

This action will also be run by a Scheduled Task every day.

Answer

DomBer picture DomBer · Nov 5, 2010

I've just try to use :

Process p = new Process();
p.StartInfo.Verb = "runas";

this works fine if I'm running my program as Administrator, but when the Scheduled Task runs it, it doesn't take the 'runas' in consideration I think.