You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What does 'go version' print?
go version go1.3.3 windows/386
What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Copy https://gist.github.com/nobeans/1fcc22ea9268746455b0 to your local machine like
test-run-bat.go.
2. Create C:\\DIR WITH SPACES\\test.bat with a content like "echo Hello"
3. Run this script `go run test-run-bat.go`
What happened?
An unexpected error occurs to run a BAT file under a path having a white-space only when
specifying a blank argument.
The error message is like this:
'C:\DIR' is not recognized as an internal or external command,
operable program or batch file.
What should have happened instead?
It should be able to run successfully as running a exe file.
Please provide any additional information below.
It doesn't occur without a blank argument even for a BAT file in Windows.
It doesn't occur with/without a blank argument for a EXE file in Windows.
And it doesn't occur with any arguments in Mac and Linux.
The text was updated successfully, but these errors were encountered:
I think, that is how windows cmd.exe works. I did this:
C:\>cmd /c "C:\DIR WITH SPACES\test.bat"
C:\>echo Hello
Hello
C:\>cmd /c "C:\DIR WITH SPACES\test.bat" ""
'C:\DIR' is not recognized as an internal or external command,
operable program or batch file.
C:\>
which looks similar to what you see in your program.
I agree, it is inconsistent, but I think we should let Windows make rules here.
Alex
Problem exists also for the exec.go module for starting a process on windows. If you intend to support the windows plattform than this needs to be fixed.
And you are right: Windows make the rule as the Linux guys do and we try to follow...
by nobeans:
The text was updated successfully, but these errors were encountered: