如何执行
来自Golang的netsh
命令需要"以管理员身份运行"?
err1 := exec.Command("netsh", "interface ipv6 set privacy state=disable").Run()
fmt.Printf("Exec1 err: %+v\n", err1)
答案 0 :(得分:1)
尝试std::wstringstream wss;
wss << std::wstring(L"\"") << CPathUtil::get_exe_fullpath() << std::wstring(L"\"") << L" /q /a " << std::wstring(L"\"") + cp.c_str() + std::wstring(L"\"");
const auto command = wss.str();
const auto result = _wsystem(command.c_str());