Created
July 26, 2012 04:53
-
-
Save xpol/3180332 to your computer and use it in GitHub Desktop.
Detect if bat file is running via double click or from cmd window
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if %cmdcmdline% == "%SystemRoot%\system32\cmd.exe" ( | |
echo from cmd window... | |
) else ( | |
pause | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if "%cmdcmdline:~4,2%"=="/c" (pause) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment