This commit is contained in:
Serge
2024-07-18 10:00:59 +02:00
parent 1a7b7b3761
commit 10163db7ea

View File

@@ -949,7 +949,10 @@ namespace GHelper.Input
if (string.IsNullOrEmpty(command)) return; if (string.IsNullOrEmpty(command)) return;
try 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) catch (Exception ex)
{ {