gpt4 book ai didi

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

转载 作者:数据小太阳 更新时间:2023-10-29 03:14:03 29 4
gpt4 key购买 nike

如何执行

netsh

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

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

最佳答案

试试 exec.Command("netsh", "interface", "ipv6", "set", "privacy", "state=disable").Run()

关于go - 如何在 Windows 上从 Golang 执行 netsh 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42204608/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com