Windows – Command line PAUSE function not working

batchcommand linepausewindows xp

I'm experienceing a problem with a batch file command – when I run the program, I have a "PAUSE" command at the end of the batch file, however, the command window still automatically closes instantly, too quickly for me to see the results. Is there another way to prevent the command window from closing, or to somehow get the results? i.e, can a printed version be sent, inserted somewhere?

Background – I know squat about command lines, so please, if you can, any response please dumb down to novice level explanations. I am ultimately trying to determine versions of a MS Project file, and have used/followed this website instructions exactly, however the results won't display for me – the command window just dissapears instantly:

Microsoft website I used for instructions:
A simple method to determine the version of an mpp file (MS Project plan file)

The text/commands within the batch file:

@ECHO OFF

REM  Version.bat

ECHO Filename: %1

ECHO.

ECHO -- CHECK FOR PROJECT VERSION --

strings %1 | findstr "[0-9],.,....,...." 2>NUL

ECHO Check the following list for the first one or two digits of the string above (xx,.,....,....)

ECHO List of xx (Product Name): 8 (98), 9 (2000), 10 (2002), 11 (2003), 12 (2007), 14 (2010)

ECHO. 

ECHO -- CHECK FOR MPP FILE VERSION --

strings %1 | findstr ".MPP" 2>NUL

ECHO Check the following list for the digit(s) at the end of the string above (...MPPxx)

ECHO List of xx (Product Name): 8 (98), 9 (2000/2002/2003), 12 (2007), 14 (2010)

ECHO.

PAUSE

Best Answer

I suspect the file has an error. Try calling the batch file from an existing command window to see the message.

Most likely the problem is that the script is calling an external program called "strings" and according to the document you linked to this can be found here. In order for the batch file to be able to find it you should install it in the directory you are running it in, otherwise you will need to modify the PATH system environment variable or put it in a system directory.

Related Question