Andrey K.
Andrey K.

Reputation: 673

How to execute netsh command from Golang on Windows

How to execute

netsh

command from Golang which requires "run as Admin"?

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

Upvotes: 0

Views: 1240

Answers (1)

cshu
cshu

Reputation: 5944

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

Upvotes: 1

Related Questions