I am an administrator for stand alone computers distributed across the US. They have not network access and the admin accounts are locked down from the users. I want to make changes to their registry via an exe that can run on their user accounts with out traveling there or giving them the admin username and password. I have figured out how to modify the registry via code, but I cannot get the code to run elevated with out UAC logging in. How do I get this to happen? I have the user name and password I just don't want to share it with them. My code is:
string command;
string user = "admin";
string password = "generalPassword";
ProcessStartInfo info = new ProcessStartInfo();
info.WorkingDirectory = @"C:\Windows\System32";
info.FileName = @"C:\Windows\System32\cmd.exe";
info.UserName = user;
SecureString pw = new SecureString();
foreach(char letter in password) {pw.AppendChar(letter);}
info.Password = pw;
info.Verb = "runas";
Process p = new Process();
command = @"/C dism /online /enable-feature /featurename:RemoteServerAdministrationTools & Pause";
info.Arguments = command;
p.Startinfo = info;
p.Start();
p.WaitForExit();