How to make the batch file to wait for user input?

While running bat files, if any error occurs, it will vanishes without waiting for the user to review it.  To overcome this issue, we can make the bat file to wait for the user input to terminate the window like getch() is being used in C programming.

To do that,  add

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

at end of the bat file.

Karthic Babu

A 27-year-old freelance journalist based in London, specialising in the media industry.

No comments :

Post a Comment

Leave a Comment...