-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
What version of Go are you using (go version)?
go version go1.8 windows/amd64
What did you do?
run executable binary and receive the message after execution from stdout on Server2008.
What did you expect to see?
excpect output: SUCCESS=0 or FAILED=1 (user-defined)
What did you see instead?
it runs normally on Win7 & Win10.
it runs exec.command() normally on Server 2008 (64bit) .
but i can not receive the return message from stdout.
otherwise,it can normally print the message when using the CMD

I have try to bind a bytes.Buffer to the stdout,and call Run() .But it still nothing to receive.
cmd := exec.Command()
var buf bytes.buffer
cmd.Stdout = &buf // catched nothing
test code :
package main
import (
"log"
"os/exec"
)
func main() {
cmd := exec.Command("tts", "hello", "D:/test.wav")
buf, err := cmd.CombinedOutput()
if err != nil {
log.Println("failed:", err)
return
}
log.Println("success:", string(buf))
}
print log:
run on win7 & win10
SUCCESS=0
run on Server 2008