I want to use Go and the exec library to go to a certain path, "c:", and run a .exe file.
When I run my Go code, it gives me:
exec: "cd:/": file does not exist
I want to use Go and the exec library to go to a certain path, "c:", and run a .exe file.
When I run my Go code, it gives me:
exec: "cd:/": file does not exist
Depending if the command needs to operate in the "root" of the directory, you can use os.Chdir(dir) to change Go programs directory. All of the subsequent commands and paths will then be relative to the value of the dir provided to os.Chdir.