Add option to run as administrator for Shell plugin

This commit is contained in:
Jeremy Wu
2019-12-06 07:49:20 +11:00
parent b47e7f068c
commit 92bde25a49
3 changed files with 27 additions and 8 deletions

View 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;
}
}
}