/errors/cmd/timeout-input-redirection-is-not-supported
timeout: ERROR: Input redirection is not supported, exiting the process immediately.
- tool
- Command Prompt (cmd)
- exit code
- 1
- versions
- Windows 10, Windows 11, Windows Server 2016+
- os
- windows
ERROR: Input redirection is not supported, exiting the process immediately. comes from timeout.exe when its standard input is not a console. timeout waits for a key press so the user can skip the wait, and it exits at once (with ERRORLEVEL 1) instead of waiting when input comes from a pipe, a file or nul. That happens in CI jobs, scheduled tasks and any ... | cmd call. Use a delay that does not read input:
powershell -NoProfile -Command "Start-Sleep -Seconds 5"
ping -n 6 127.0.0.1 > nulping -n 6 sends six echo requests one second apart, which takes about five seconds.
Reproduce it
%SystemRoot%\System32\timeout.exe /t 1 < nul 2>&1
echo timeout: ERRORLEVEL=%ERRORLEVEL%
powershell -NoProfile -Command "Start-Sleep -Seconds 1"
echo Start-Sleep: ERRORLEVEL=%ERRORLEVEL%Output
ERROR: Input redirection is not supported, exiting the process immediately. timeout: ERRORLEVEL=1 Start-Sleep: ERRORLEVEL=0
The block calls timeout.exe by full path for the reason in the next section.
Options
| Delay | Reads input | Notes |
|---|---|---|
| timeout /t 5 | yes | any key skips the wait; fails when input is redirected |
| timeout /t 5 /nobreak | yes (only Ctrl+C) | still needs a console |
| timeout /t -1 | yes | waits for a key indefinitely |
| ping -n 6 127.0.0.1 > nul | no | about 5 seconds; works everywhere |
| powershell -NoProfile -Command "Start-Sleep -Seconds 5" | no | exact; starts a PowerShell process |
timeout: invalid time interval '/t'
If timeout /t 5 prints timeout: invalid time interval '/t', the command that ran is the GNU timeout from Git for Windows, MSYS2 or Cygwin, because its folder comes before C:\Windows\System32 in PATH. Check with where timeout, and call %SystemRoot%\System32\timeout.exe explicitly in batch files that must work on such machines.