C
C#2y ago
trumats

❔ How to make so my app launcher another app with admin rights

public void Button_Click(object sender, RoutedEventArgs e)
{
ProcessStartInfo info = new ProcessStartInfo("RigaUpdater.exe");
info.UseShellExecute = true;
info.Verb = "runas";
Process.Start(info);
App.Current.Shutdown();
//Process.Start("RigaUpdater.exe");
}
public void Button_Click(object sender, RoutedEventArgs e)
{
ProcessStartInfo info = new ProcessStartInfo("RigaUpdater.exe");
info.UseShellExecute = true;
info.Verb = "runas";
Process.Start(info);
App.Current.Shutdown();
//Process.Start("RigaUpdater.exe");
}
3 Replies
trumats
trumatsOP2y ago
This opens it... but not with admin Rights @SleepWellPedro Ideas
Bailey
Bailey2y ago
the following is not mine, you should look at : https://stackoverflow.com/questions/2532769/how-to-start-a-process-as-administrator-mode-in-c-sharp however if you want admin rights without knowing the password then it sshould be blocked because if it isn't virusses can use this
Stack Overflow
How to start a Process as administrator mode in C#
I have a Visual Studio Windows app project. I've added code to download an installer update file. The installer after it has finished downloading would need administrator privileges to run. I have ...
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?