diff --git a/src/windows.rs b/src/windows.rs index 4c4bf71..1fe7441 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -5,12 +5,15 @@ use std::{ use std::os::windows::process::CommandExt; +const CREATE_NO_WINDOW: u32 = 0x08000000; + pub fn commands>(path: T) -> Vec { let mut cmd = Command::new("cmd"); cmd.arg("/c") .arg("start") .raw_arg("\"\"") - .raw_arg(wrap_in_quotes(path)); + .raw_arg(wrap_in_quotes(path)) + .creation_flags(CREATE_NO_WINDOW); vec![cmd] } @@ -18,7 +21,8 @@ pub fn with_command>(path: T, app: impl Into) -> Command let mut cmd = Command::new("cmd"); cmd.arg("/c") .raw_arg(app.into()) - .raw_arg(wrap_in_quotes(path)); + .raw_arg(wrap_in_quotes(path)) + .creation_flags(CREATE_NO_WINDOW); cmd }