Only 'pause' a batch script if not run from commandline

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nagger
Posts: 1
Joined: 01 Feb 2013 17:26

Only 'pause' a batch script if not run from commandline

#1 Post by nagger » 01 Feb 2013 17:38

Using the 'pause' command at the end of a script will prevent the dos-box from closing.
But this 'pause' command is annoying, if the bat-script is call from within an already opened dos-box.

Is there a way to find out if the script was started from command-line?

Thanks

carlos
Expert
Posts: 503
Joined: 20 Aug 2010 13:57
Location: Chile
Contact:

Re: Only 'pause' a batch script if not run from commandline

#2 Post by carlos » 01 Feb 2013 19:28

Maybe check this:

Code: Select all

If Defined CmdCmdLine

Post Reply