mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Add option to run as administrator for Shell plugin
This commit is contained in:
24
Wox.Plugin/SharedCommands/ShellCommand.cs
Normal file
24
Wox.Plugin/SharedCommands/ShellCommand.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Wox.Plugin.SharedCommands
|
||||
{
|
||||
public static class ShellCommand
|
||||
{
|
||||
public static ProcessStartInfo SetCMDRunAsAdministrator(this string fullPath, string parentDirectory)
|
||||
{
|
||||
var info = new ProcessStartInfo
|
||||
{
|
||||
FileName = fullPath,
|
||||
WorkingDirectory = parentDirectory,
|
||||
Verb = "runas"
|
||||
};
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user