This article covers how to pause a script execution and the user enters the key to resume the script execution.
This is used to take input from the user or delay the batch job execution
It is like pausing a batch script execution and waiting for the user to enter the key input.
Pause with entering the key in dos batch programming
There are multiple ways we can do
First Way, using set /p
set /p test=Please press ENTER Key to continue.
A:\work\w3schools\dos>set /p test=Hit ENTER to continue...
Hit ENTER to continue...
Second-way using pause
Pause suspends execution until the user enters any input key is pressed.
@echo off
echo Line1
pause "Please enter any key"
echo Line2
pause
Output:
It waits for the user input key to enter.