Possible Duplicate:
Conditional PAUSE (not in command line)
I have a .bat file that does some processing and prints some output and people likely want to check that output. Different people (depending on their personal preferences and work flow) run this file differently: some using "Start->run" dialog, some start it from explorer, some start cmd.exe
then start this .bat file from there.
If I just put the pause
at the end of the .bat file it will allow users that don't run it from cmd
to see the output, but it frustrates the ones that run it from cmd
because they are required to press any key for no reason (they will not loose output in any case). If I don't put that pause
then people that don't use cmd
will not see the output.
I want to detect if the new console was allocated to run the .bat file and run or not run pause
depending on it. Is it possible? Or is there any other solutions?