Possible duplicate:
Conditional PAUSE (not on the command line)
I have a .bat file that does some processing and prints some result, and people will probably want to check this output. Different people (depending on their personal preferences and workflow) run this file in different ways: some use the Start-> Run dialog, some start it from Windows Explorer, some start cmd.exe , and then run this .bat file.
If I just put pause at the end of the .bat file, it will allow users who do not start it from cmd to view the output, but it upsets those that start it from cmd because they have to press any key for no reason (in in any case, they will not lose output). If I do not put this pause , then people who do not use cmd will not see the result.
I want to determine if a new console has been allocated to run the .bat file and whether or not to start pause depending on it. Is it possible? Or are there any other solutions?
source share