Search code examples
windowsbatch-filecmdtimeout

Cant use default option more than one time(s)


i am trying to use the "timeout" command in a batch script, and it says "ERROR: Invalid syntax. Default option is not allowed more than one time(s)" and it closes the script after. Can anyone help me fix this? The code is as follows

@echo off
title {REDACTEDPRIVATESTACKOVERFLOW}

echo {REDACTEDPRIVATESTACKOVERFLOW}

timeout /t 3 /timeout 

echo {REDACTEDPRIVATESTACKOVERFLOW}

Solution

  • It just worked for me in the following way:

    echo "hi"
    
    timeout 3
    
    echo "hi"