I am trying to make a go program that calls another program (with a GUI) by command line.
Using os/exec package. The external program starts, but it always runs in the background. (Even if I try to start "Notepad.exe" or a .bat file which then calls the actual program.)
In the task manager you can see the process but there no way to interact with it.
Here's an example of code I've been experimenting with:
cmd := exec.Command("cmd.exe", "/C", "start", "\"\"", `Notepad.exe`)
log.Println("cmd.exe", "/C", "start", "\"\"", `Notepad.exe`)
cmd.Stdout = os.Stdout
if err := cmd.Start(); err != nil {
log.Println("Error: ", err)
}
Is there a way to alter the code so it starts "Notepad.exe" in a way it can be interacted with via the UI?
I am trying this with a program on Windows compiled on Mac.