MS-DOS Batch file pause with enter key

dr_rk picture dr_rk · Apr 30, 2013 · Viewed 288.8k times · Source

Is it possible in MS-DOS batch file to pause the script and wait for user to hit enter key?

I wish to do this inside a for loop. After each iteration, I want the script to pause and wait for user to hit 'Enter'

Answer

abjuk picture abjuk · Apr 30, 2013

There's a pause command that does just that, though it's not specifically the enter key.

If you really want to wait for only the enter key, you can use the set command to ask for user input with a dummy variable, something like:

set /p DUMMY=Hit ENTER to continue...