How do I use exec.command to start a file with spaces? Adding quotes doesn't seem to work, neither does " or %20 instead of the spaces.
package main
import (
"fmt"
"os/exec"
)
func main() {
StartProcess("C:\\File With Spaces.txt")
}
func StartProcess(Filename string) {
Filename = "\"" + Filename + "\""
cmd := exec.Command("cmd","/C start",Filename)
err := cmd.Start()
if err!=nil{
fmt.Println(err)
}
}