timeoutTIMEOUT Command Guide - Pause and Add Delays in Windows CMD
Learn how to use the TIMEOUT command to pause batch scripts and add delays in Windows. Includes /t seconds, /nobreak option, examples, and scripting best practices.
The TIMEOUT command is a Windows Command Prompt utility that pauses script execution for a specified number of seconds. Use TIMEOUT /t 10 to wait 10 seconds, or TIMEOUT /t 5 /nobreak to wait without allowing the user to skip by pressing a key. Essential for batch scripts that need delays between operations, user prompts, or rate limiting.
Whether you're writing deployment scripts that require pauses between steps, creating user-facing batch files that display messages before continuing, or implementing simple rate limiting in automation, the TIMEOUT command provides a built-in delay mechanism. System administrators and script authors use TIMEOUT instead of third-party sleep utilities for portable, native Windows delays.
This comprehensive guide covers TIMEOUT syntax, the /t and /nobreak options, practical examples for scripting, troubleshooting tips, related commands, and frequently asked questions. By the end, you'll confidently add delays to your batch scripts and automation workflows.
What Is the TIMEOUT Command?
The TIMEOUT command:
- Pauses execution – Halts the command processor for a specified duration
- Displays countdown – Shows "Waiting X seconds, press a key to continue..."
- Optional key skip – By default, any key press aborts the wait; use
/nobreakto disable - Range 1–99999 seconds – Supports delays from 1 second to over 27 hours
- Replaces deprecated SLEEP – Modern replacement for the old Resource Kit sleep utility
TIMEOUT was introduced in Windows Vista and is available in Windows 7, 8, 10, 11, and Windows Server. It works in Command Prompt and batch scripts. Requires no special permissions.
TIMEOUT Command Syntax
TIMEOUT [/t seconds] [/nobreak]
Parameters
| Parameter | Description |
|---|---|
/t seconds | Number of seconds to wait (1–99999). Default is 10 if not specified |
/nobreak | Ignore key presses; wait for full duration |
Important Notes
- If
/tis omitted and no seconds given, TIMEOUT waits 10 seconds - Without
/nobreak, pressing any key immediately continues - The countdown updates every second
Examples
Wait 5 Seconds
TIMEOUT /t 5
Output:
Waiting 5 seconds, press a key to continue ...
Wait 30 Seconds, No Key Skip
TIMEOUT /t 30 /nobreak
Useful when you must ensure a full delay (e.g., before shutdown) and don't want users to skip.
Wait 10 Seconds (Default)
TIMEOUT
Equivalent to TIMEOUT /t 10.
Use in Batch Script
@echo off
echo Starting backup in 10 seconds...
TIMEOUT /t 10 /nobreak
echo Backup starting now.
robocopy C:\Data D:\Backup /E
echo Backup complete.
pause
Common Use Cases
- Deployment scripts – Pause between installation steps to allow services to start
- User prompts – Give users time to read messages before continuing
- Rate limiting – Add delays between API calls or file operations
- Pre-shutdown delay – Use before SHUTDOWN to allow users to cancel
- Retry logic – Wait before retrying failed operations
Tips and Best Practices
- Use
/nobreakwhen the delay is critical (e.g., before shutdown) - For very long delays, consider splitting or using a loop
- Combine with
echoto provide context:echo Waiting for service... & TIMEOUT /t 5 - Redirect key input to simulate /nobreak in older Windows:
TIMEOUT /t 5 > nul(behavior varies)
Troubleshooting
"Invalid syntax"
Ensure /t is followed by a number. Use TIMEOUT /t 10 not TIMEOUT 10 (though some versions accept both).
Script continues immediately
Without /nobreak, any key press (including Enter) skips the wait. Add /nobreak if you need a guaranteed delay.
TIMEOUT not recognized
TIMEOUT is available from Windows Vista onward. On older systems, use ping -n 6 127.0.0.1 > nul as a workaround (waits ~5 seconds).
Related Commands
shutdown – System Shutdown
Use TIMEOUT before SHUTDOWN to give users time to save work: TIMEOUT /t 60 /nobreak & SHUTDOWN /s
pause – Wait for Key Press
PAUSE waits indefinitely for a key; TIMEOUT waits for a specific duration (or key press).
ping – Alternative Delay
On very old Windows, ping -n 6 127.0.0.1 > nul creates a ~5 second delay (6 pings, 1 second apart).
Frequently Asked Questions
How do I wait 1 minute in a batch file?
Use TIMEOUT /t 60 for 60 seconds. Add /nobreak if you don't want the user to skip.
Can I suppress the TIMEOUT message?
Redirect output: TIMEOUT /t 5 > nul. The countdown message is hidden but the wait still occurs.
What is the maximum TIMEOUT value?
99999 seconds (about 27.7 hours).
Does TIMEOUT work in PowerShell?
TIMEOUT is a CMD command. In PowerShell, use Start-Sleep -Seconds 10 instead.
How do I make a batch file wait without user interaction?
Use TIMEOUT /t 10 /nobreak to wait 10 seconds without allowing key skip.
Quick Reference Card
| Command | Purpose | Example |
|---|---|---|
TIMEOUT /t 5 | Wait 5 seconds | Short delay |
TIMEOUT /t 60 /nobreak | Wait 60 seconds, no skip | Guaranteed delay |
TIMEOUT | Wait 10 seconds (default) | Quick pause |
Summary
The TIMEOUT command provides native, portable delays for Windows batch scripts. Use /t for duration and /nobreak when key skip must be disabled. Essential for deployment scripts, user prompts, and automation. Practice in the simulator or browse the commands reference for more Windows command guides.