Windows timeout Command

As noted in my last post, I came across two commands I had no idea natively existed in Windows. The previous one is waitfor. This command is timeout. WOW. This would have been nice to have known previous for many of my batch scripts instead of hacking up for loops to simulate a wait timeout. Argh!

TIMEOUT [/T] timeout [/NOBREAK]
Description:
    This utility accepts a timeout parameter to wait for the specified
    time period (in seconds) or until any key is pressed. It also
    accepts a parameter to ignore the key press.
Parameter List:
    /T        timeout       Specifies the number of seconds to wait.
                            Valid range is -1 to 99999 seconds.
    /NOBREAK                Ignore key presses and wait specified time.
    /?                      Displays this help message.
NOTE: A timeout value of -1 means to wait indefinitely for a key press.
Examples:
    TIMEOUT /?
    TIMEOUT /T 10
    TIMEOUT /T 300 /NOBREAK
    TIMEOUT /T -1

Published by

Rich

Just another IT guy.

Leave a Reply

Your email address will not be published. Required fields are marked *