mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Add option to run as administrator for Shell plugin
This commit is contained in:
@@ -10,6 +10,7 @@ using Microsoft.Win32;
|
||||
using Shell;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Plugin.Program.Logger;
|
||||
using Wox.Plugin.SharedCommands;
|
||||
|
||||
namespace Wox.Plugin.Program.Programs
|
||||
{
|
||||
@@ -96,14 +97,7 @@ namespace Wox.Plugin.Program.Programs
|
||||
Title = api.GetTranslation("wox_plugin_program_run_as_administrator"),
|
||||
Action = _ =>
|
||||
{
|
||||
var info = new ProcessStartInfo
|
||||
{
|
||||
FileName = FullPath,
|
||||
WorkingDirectory = ParentDirectory,
|
||||
Verb = "runas"
|
||||
};
|
||||
var hide = Main.StartProcess(info);
|
||||
return hide;
|
||||
return Main.StartProcess(ShellCommand.SetCMDRunAsAdministrator(FullPath, ParentDirectory));
|
||||
},
|
||||
IcoPath = "Images/cmd.png"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user