From 10163db7eabb961d018fbb4243f354c18af2c4d6 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Thu, 18 Jul 2024 10:00:59 +0200 Subject: [PATCH] LaunchProcess tweak https://github.com/seerge/g-helper/issues/2860 --- app/Input/InputDispatcher.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 1f9f8ddd..ea9a0b52 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -949,7 +949,10 @@ namespace GHelper.Input if (string.IsNullOrEmpty(command)) return; try { - RestrictedProcessHelper.RunAsRestrictedUser(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe"), "/C " + command); + if (command.StartsWith("shutdown")) + ProcessHelper.RunCMD("cmd", "/C " + command); + else + RestrictedProcessHelper.RunAsRestrictedUser(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe"), "/C " + command); } catch (Exception ex) {