I'm trying to call a built in command for the command prompt and I'm getting errors I don't understand.
func main() {
cmd := exec.Command("del", "C:\trial
ow.txt")
// Reboot if needed
cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil {
log.Fatal(err)
}
}
And I'm getting the following error:
exec: "del": executable file not found in %PATH%
exit status 1
What am I doing wrong?