package ShellUtils import ( "fmt" "os/exec" ) //封装一个函数来执行命令 func ExecCommand(cmdLine string) { cmd := exec.Command("cmd.exe", "/c", cmdLine) err := cmd.Run() cmd.Wait() fmt.Printf("%s, error:%v \n", cmdLine, err) }