I am creating a simple batch file to assist in a few things, and I have some instructions that it prints out as well that I want the user to see before exit. Currently, the window closes very quickly. So I added PAUSE at the end of the file, but it does not want to work.
I looked at other questions on SO and have checked to make sure the line endings are CRLF and that I have CRLF at the end of the file.
Any suggestions?
If the last command fails pause won’t work.
You can fix it by putting "call" in front of the command you are running (whatever command is before the pause) then the pause will work.
So for example I had a phpunit batch file that looked like this:
When phpunit failed it just exited without pausing. Changing it to this made it pause correctly: