1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
@echo off echo %CmdCmdLine% | find /i "cmd /c" >NUL if errorlevel 1 ( set PauseExplorer= ) else ( set PauseExplorer=pause ) echo Script start type detection. echo Will only prompt for a key press if started from Explorer. %PauseExplorer%