I have an exe that a normal user will run, but it needs to merge a REG file, which requires UAC popup asking for the admin password, which I do not want to provide to user.
Is there a way for me to pass in the password in process.StartInfo
so UAC doesn't have to ask for the password?
If I do this:
process.StartInfo.Domain = "XYZ";
process.StartInfo.UserName = "admin";
process.StartInfo.Password = "";
It tells me I need to be evelated.
I have also tried to impersonate the admin account, then:
process.StartInfo.Verb = "runas";
process.start()
But it will crash with:
Unhandled Exception: System.ComponentModel.Win32Exception: Unknown error (0xfffffffe)