Add Timeout/Pause to Batch File - Windows Command Line

Pausing Batch File Execution with the Timeout Command
When creating batch files, a need often arises to halt execution until a user interacts with the system. The timeout command provides a straightforward method for accomplishing this.
Implementing a Time-Based Pause
A temporary pause can be introduced into a batch script using the timeout command. For example, the following command, when executed in the command prompt, will suspend processing for a duration of 10 seconds.
timeout /t 10
However, this pause is interruptible; pressing any key will immediately resume the script's execution.
Pausing Without Key Interruption
To enforce a pause of a specific length, regardless of user input, the /nobreak switch is utilized. This ensures the script remains paused for the designated time.
timeout /t 30 /nobreak
In this instance, the terminal will be paused for 30 seconds, and no key press will prematurely end the delay.
Indefinite Pausing Until Key Press
For situations requiring the script to remain paused until explicit user intervention, a value of -1 is assigned to the /t parameter. This creates an indefinite pause.
timeout /t -1
The script will remain suspended until a key is pressed, at which point execution will continue.
These methods offer flexible control over the timing and interruption behavior of pauses within batch files, enhancing script functionality and user interaction.