Pass /D flag to cmd.exe to disable AutoRun (#4903)

* 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
This commit is contained in:
LebsterFace 2022-03-23 06:05:06 +00:00 committed by GitHub
parent a435a9924c
commit e826540037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {