shortcut to launch windows environment variables
package main
import (
"fmt"
"os"
"os/exec"
)
func main() {
cmd := exec.Command("cmd", "/c", "start", "control", "sysdm.cpl,,3")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
fmt.Println("Error:", err)
}
}
This Go code launches the Windows environment variables window using the cmd
command with parameters /c
, start
, control
, and sysdm.cpl,,3
. It utilizes the os/exec
package to execute the command in the system's command shell.