Reputation: 13
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?
Upvotes: 0
Views: 73
Reputation: 51711
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.
Upvotes: 1