I have a batch file that I'd like to be able to be run by double-clicking on the file in Windows Explorer. When this is done, I want to end with a PAUSE so the window doesn't immediately close.
But if the batch file is run from a command shell, I'd prefer to not end with a PAUSE.
Is there some way to tell, within a batch file, whether it is running in a command-line spawned from Windows Explorer, or from an existing command shell?
Bash provides the special $- environment variable.
Is there something similar in cmd.exe?