Closed isensen closed 5 months ago
Hello, when using exec.Command, you can use the following code to hide the console window, may I ask how go-cmd achieve the same effect?
taskCmd := exec.Command("cmd", "/c", "tasklist") taskCmd .SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
cmd.Options{
// ......
BeforeExec: []func(cmd *exec.Cmd){
func(cmd *exec.Cmd) {
cmd.SysProcAttr = &syscall.SysProcAttr{
HideWindow: true,
}
},
},
}
Hello, when using exec.Command, you can use the following code to hide the console window, may I ask how go-cmd achieve the same effect?
taskCmd := exec.Command("cmd", "/c", "tasklist") taskCmd .SysProcAttr = &syscall.SysProcAttr{HideWindow: true}
cmd.Options{ // ...... BeforeExec: []func(cmd *exec.Cmd){ func(cmd *exec.Cmd) { cmd.SysProcAttr = &syscall.SysProcAttr{ HideWindow: true, } }, }, }
Thank you
Hello, when using exec.Command, you can use the following code to hide the console window, may I ask how go-cmd achieve the same effect?