rust-打开windows10电脑启动配置
main.rs
#![windows_subsystem = "windows"]
use std::process::Command;
use std::os::windows::process::CommandExt;
fn main() {
let output = if cfg!(target_os = "windows") {
Command::new("cmd")
.creation_flags(0x08000000)
.arg("/C")
.arg("msconfig")
.output()
.expect("failed to execute process")
} else {
Command::new("sh")
.arg("-c")
.arg("echo hello")
.output()
.expect("failed to execute process")
};
let hello = output.stdout;
println!("{:?}", hello);
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询