update StartInfo arguments if cmd shell type

This commit is contained in:
Jeremy 2021-11-18 06:15:38 +11:00
parent 8cf93907e9
commit a7ef5895b7

View file

@ -109,7 +109,9 @@ namespace Flow.Launcher
public void ShellRun(string cmd, string filename = "cmd.exe")
{
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: $"/C {cmd}", createNoWindow: true);
var args = filename == "cmd.exe" ? $"/C {cmd}" : $"{cmd}";
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true);
ShellCommand.Execute(startInfo);
}