Execute the .bat file directly on install to avoid the replacement of cmd (#6817)

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2024-01-06 20:28:46 +08:00 committed by GitHub
parent f4ef1455c4
commit cdc31b7fc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1221,8 +1221,9 @@ fn run_cmds(cmds: String, show: bool, tip: &str) -> ResultType<()> {
let tmp = write_cmds(cmds, "bat", tip)?;
let tmp2 = get_undone_file(&tmp)?;
let tmp_fn = tmp.to_str().unwrap_or("");
let res = runas::Command::new("cmd")
.args(&["/C", &tmp_fn])
// https://github.com/rustdesk/rustdesk/issues/6786#issuecomment-1879655410
// Execute the .bat file directly to avoid the replacement of cmd
let res = runas::Command::new(&tmp_fn)
.show(show)
.force_prompt(true)
.status();