Skip to content

/errors/cmd/timeout-input-redirection-is-not-supported

timeout: ERROR: Input redirection is not supported, exiting the process immediately.

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated
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:

cmd
powershell -NoProfile -Command "Start-Sleep -Seconds 5"
ping -n 6 127.0.0.1 > nul

ping -n 6 sends six echo requests one second apart, which takes about five seconds.

Reproduce it

cmd
%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

DelayReads inputNotes
timeout /t 5yesany key skips the wait; fails when input is redirected
timeout /t 5 /nobreakyes (only Ctrl+C)still needs a console
timeout /t -1yeswaits for a key indefinitely
ping -n 6 127.0.0.1 > nulnoabout 5 seconds; works everywhere
powershell -NoProfile -Command "Start-Sleep -Seconds 5"noexact; 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.

Sources