0

For example, I get the result of Query User by calling powershell.exe:

let output = Command::new("powershell.exe")
    .arg("Query")
    .arg("User")
    .output()?;

// Parse the output in std... 

Unfortunately, doing so will bring up a powershell window (although it will soon disappear).

Is there a way to call the console program without displaying any windows?

Masklinn
  • 34,759
  • 3
  • 38
  • 57
Hentioe
  • 228
  • 1
  • 9
  • I am not able to reproduce the issue. – Abdul Niyas P M Jan 28 '21 at 04:39
  • 1
    This has nothing to do with Rust, `Command` is just doing what you tell it to do, namely run powershell. To run powershell without a window, see: [how to run a PowerShell script without displaying a window?](https://stackoverflow.com/questions/1802127/how-to-run-a-powershell-script-without-displaying-a-window) – Masklinn Jan 28 '21 at 06:32

0 Answers0