I'm writing a go application that just uses the command window (CMD) for user input and output. I need to launch another instance of the application that is using its own window.
I trying to use the "os/exec" package but that only creates a window for GUI apps. I tried executing the application with cmd /c ___
but it still hasn't created a separate window.
Is there a way to launch a non-GUI application with its own window, stdin and stdout?
I found it!
The trick is to use the "start" as a command after cmd /c
Here's the code:
cmd:= exec.Command("cmd","/C","start",_path_to_executable_)
err=cmd.Start()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With