Detect whether Go program is run from cmd.exe

I’m having a hard time searching on this one, and I have very limited knowledge of Windows systems.

How can I tell, with reasonable certainty, if the program was run from, say, Windows Explorer (by double-clicking the icon) – or anything that’s not cmd.exe? Any Windows gurus know some way to do this within a Go program?

Specifically the mousetrap package: https://github.com/inconshreveable/mousetrap

3 Likes

That’s PERFECT. Never would have found that on my own… Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.