Pass `/D` flag to `cmd.exe` to disable AutoRun
* Pass `/D` flag to `cmd.exe` to disable AutoRun
* Pass `/D` flag before `/c`
This avoids running the command '/D <&self.name.item>' in cmd
@@ -469,6 +469,12 @@ impl ExternalCommand {
/// Spawn a cmd command with `cmd /c args...`
pub fn spawn_cmd_command(&self) -> std::process::Command {
let mut process = std::process::Command::new("cmd");
+
+ // Disable AutoRun
+ // TODO: There should be a config option to enable/disable this
+ // Alternatively (even better) a config option to specify all the arguments to pass to cmd
+ process.arg("/D");
+
process.arg("/c");
process.arg(&self.name.item);
for arg in &self.args {
