Hi,
I'm trying to open a file in Windows 7 with its default program using the start command using Go 1.3 stable windows/amd64
On the Windows command line, when i type the following, it works perfectly:
cmd /c start "" "c:\some path\with spaces\in it\thefile.pptx"
However, if i try to run the following in Go, I get an popup alert box from Windows saying - "Windows cannot find `\\`. Check the spelling and try again, or try searching for the item by clicking the Start button and then clicking Search".
cmd := exec.Command("cmd", "/c", "start \"\" \"c:\\some path\\with spaces\\in it\\thefile.pptx\"")
err := cmd.Start()
if err != nil {
fmt.Println(err)
}
This also gives the same error:
cmd := exec.Command("cmd", "/c", `start "" "c:\\some path\\with spaces\\in it\\thefile.pptx"`)
I'm guessing what's being run by exec.Cmd is not equivalent to what i typed on the Windows command line. Any pointers to what i'm doing wrong?
Best Regards
Srinath