timeout

Windows CMD · Terminal · reference only

What it does

Waits the given number of seconds, or until a key is pressed. It is the usual way to pause a .bat script.

Syntax

timeout /t segundos [/nobreak]

Options and parameters

  • /t segundos

    Seconds to wait; up to 99999 are accepted.

  • /t -1

    Waits indefinitely until a key is pressed.

  • /nobreak

    Ignores key presses; it can only be interrupted with Ctrl+C.

  • > nul

    Hides the countdown message.

Usage examples

  • timeout /t 10

    Waits 10 seconds or until a key is pressed.

  • timeout /t 5 /nobreak

    Waits 5 seconds without a key press interrupting it.

  • timeout /t -1

    Waits until a key is pressed.

  • timeout /t 3 > nul

    Waits 3 seconds without showing the countdown.

Notes and common mistakes

  • Not to be confused with Linux's timeout command, which limits another program's running time.
  • In consoles without input, such as some scheduled tasks, it can fail with an input redirection error.

Related commands