You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zk/util/exec/exec_windows.go

19 lines
356 B
Go

package exec
import (
"fmt"
"os/exec"
"syscall"
)
// CommandFromString returns a Cmd running the given command.
func CommandFromString(command string) *exec.Cmd {
cmd := exec.Command("cmd")
cmd.SysProcAttr = &syscall.SysProcAttr{
HideWindow: false,
CmdLine: fmt.Sprintf(` /v:on/s/c "%s"`, command),
CreationFlags: 0,
}
return cmd
}