Batch file to determine if using Command Prompt <p>The last line in my batch file is <code>pause</code>. Is there any way to add a if condition to see if the script is run within command prompt or by double clicking to execute? I want to skip pause if it's running in command prompt.</p> <pre><code>... ... if not RUN_IN_COMMAND_PROMPT ( pause ) </code></pre> <p>EDIT: Hope to find a solution works in Windows Server 2003/2008, WinXP, Win7.</p>