Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Windows上从Golang执行netsh命令_Go_Netsh - Fatal编程技术网

如何在Windows上从Golang执行netsh命令

如何在Windows上从Golang执行netsh命令,go,netsh,Go,Netsh,如何执行 netsh 来自Golang的命令,需要以管理员身份运行 err1 := exec.Command("netsh", "interface ipv6 set privacy state=disable").Run() fmt.Printf("Exec1 err: %+v\n", err1) 请尝试exec.Commandnetsh、interface、ipv6、set、privacy、state=disable。运行,然后以管理员身份运行或将清单文件嵌入exe文件withhttps:

如何执行

netsh

来自Golang的命令,需要以管理员身份运行

err1 := exec.Command("netsh", "interface ipv6 set privacy state=disable").Run()
fmt.Printf("Exec1 err: %+v\n", err1)

请尝试exec.Commandnetsh、interface、ipv6、set、privacy、state=disable。运行

,然后以管理员身份运行或将清单文件嵌入exe文件withhttps://github.com/akavel/rsrc@安德烈。符文?