Program running in administrative mode needs to run another application in non-administrative mode?

75 views Asked by At

I have a program that runs in administrative mode. This program should run another application. Since my application is run in administrative mode, the new application is run in administrative too. How to run this new application in non-administrative mode?

1

There are 1 answers

0
Binary Worrier On

What you want is Process.Start passing a StartInfo object specifies the credentials of the use you want to start the process as.

Process.Start Method (ProcessStartInfo)

Something like this should get you started . . .

var startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.FileName = "Myexe.exe";
startInfo.UserName = "Myuser";
startInfo.Password = "MyUsersPassword";
System.Diagnostics.Process.Start(startInfo);

If you want it to run as the current user, but not in admin mode, try passing the current users credentials, I haven't tested it, but it might work.