Skip to content

Commit

Permalink
Merge pull request #174 from BlythMeister/handle
Browse files Browse the repository at this point in the history
When calling handle you need to set UseShellExecute to true to run as admin
  • Loading branch information
Yewridge authored May 16, 2023
2 parents 18e05a4 + 8c543e5 commit 4136e0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Ensconce.Cli/ApplicationInteraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ on p.Id equals (int)(uint)mo["ProcessId"]
private static string RunHandleAndGetOutput(string handleExe, string searchFolder)
{
var p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.UseShellExecute = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName = handleExe;
Expand All @@ -219,7 +219,7 @@ private static string RunHandleAndGetOutput(string handleExe, string searchFolde
private static void ReleaseHandle(string handleExe, string handleHash, string pid)
{
var p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.UseShellExecute = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName = handleExe;
Expand Down

0 comments on commit 4136e0a

Please sign in to comment.