mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Support administrator handling for ShellRun api function
This commit is contained in:
parent
3493446d3e
commit
7ea76b8539
2 changed files with 4 additions and 2 deletions
|
|
@ -42,6 +42,9 @@ namespace Flow.Launcher.Plugin
|
|||
/// <summary>
|
||||
/// Run a shell command
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It can help to start a de-elevated process and show user account control dialog when Flow is running as administrator.
|
||||
/// </remarks>
|
||||
/// <param name="cmd">The command or program to run</param>
|
||||
/// <param name="filename">the shell type to run, e.g. powershell.exe</param>
|
||||
/// <exception cref="FileNotFoundException">Thrown when unable to find the file specified in the command </exception>
|
||||
|
|
|
|||
|
|
@ -158,8 +158,7 @@ namespace Flow.Launcher
|
|||
{
|
||||
var args = filename == "cmd.exe" ? $"/C {cmd}" : $"{cmd}";
|
||||
|
||||
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true);
|
||||
ShellCommand.Execute(startInfo);
|
||||
StartProcess(filename, arguments: args, createNoWindow: true);
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD100:Avoid async void methods", Justification = "<Pending>")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue