Skip to content
- check if run by double click, or from the command line prompt
** [http://stackoverflow.com/questions/6796319/batch-file-to-determine-if-using-command-prompt http://stackoverflow.com/questions/6796319/batch-file-to-determine-if-using-command-prompt] second answer:
If /I “%COMSPEC%” == %CMDCMDLINE% Goto SkipPause
pause
:SkipPause
** even if “call”ed, the result is the same.
** when “call”ed, %CMDCMDLINE% doesn’t change, i.e., it remains the same during the entire execution of cmd.exe. therefore to discriminate this case, use findstr to compare %CMDCMDLINE% with %0. do not forget to \ to \, since findstr uses regexp .