diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index 00e038a9..e0fd352e 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -7267,7 +7267,13 @@ namespace IDE } } - public ExecutionInstance DoRun(String inFileName, String args, String workingDir, ArgsFileKind useArgsFile, Dictionary envVars = null, String stdInData = null) + public enum RunFlags + { + None, + ShellCommand = 1 + } + + public ExecutionInstance DoRun(String inFileName, String args, String workingDir, ArgsFileKind useArgsFile, Dictionary envVars = null, String stdInData = null, RunFlags runFlags = .None) { //Debug.Assert(executionInstance == null); @@ -7285,6 +7291,18 @@ namespace IDE if (stdInData != null) startInfo.RedirectStandardInput = true; startInfo.CreateNoWindow = true; + + if (runFlags.HasFlag(.ShellCommand)) + { + String shellArgs = scope .(); + shellArgs.Append("/c "); + IDEUtils.AppendWithOptionalQuotes(shellArgs, fileName); + shellArgs.Append(" "); + shellArgs.Append(args); + startInfo.SetFileName("cmd.exe"); + startInfo.SetArguments(shellArgs); + } + if (envVars != null) { for (var envKV in envVars) diff --git a/IDE/src/ScriptManager.bf b/IDE/src/ScriptManager.bf index 35de7d0b..9a20d180 100644 --- a/IDE/src/ScriptManager.bf +++ b/IDE/src/ScriptManager.bf @@ -1301,7 +1301,9 @@ namespace IDE { var exeArgs = scope String(); exeArgs.Append(cmd, spacePos + 1); - gApp.DoRun(exePath, exeArgs, gApp.mInstallDir, .None); + + bool wantsShellCommand = !exePath.EndsWith(".exe", .OrdinalIgnoreCase); + gApp.DoRun(exePath, exeArgs, gApp.mInstallDir, .None, null, null, wantsShellCommand ? .ShellCommand : .None); } }