When launching a program as an Administrator from Windows Explorer, I can right click on it and choose "Run as Administrator" and it just works.
However, from everything I've seen so far, to be able to run a program from C# (System.Diagnostics.Process
) or cmd, you need to specify a password for the "administrator" account.
So, my question is, how can run a program programmatically just as "Run as Administrator" does (with no password prompt)?
Update
I have a program that's being run as an administrator using "Run as Administrator" context menu option. In this program, I run a batch script using System.Diagnostics.Process
, but this batch script doesn't seem to run with administrator privileges.
So, how do I make the batch script I'm programmatically executing using System.Diagnostics.Process
run with administrator privileges?
Thank you in advance.