The code:
package main
import (
"fmt"
"os/exec"
)
func main() {
cmd := exec.Command("route", "ADD", "10.20.30.40", "MASK 255.255.255.255",
"192.168.12.14")
ret, err := cmd.CombinedOutput()
if err != nil {
fmt.Println(string(ret))
}
}
I run this code under nomal and administrator model, and get the same result:
Then I write some Python code:
import os
print(os.popen("route ADD 10.20.30.40 MASK 255.255.255.255 192.168.12.13").readlines()[0])
I got different result with different console model. And the output is just the same as I run the command directly.