【发布时间】:2013-08-01 20:30:09
【问题描述】:
首先,我使用的是 64 位 Windows 7,如果它有所作为的话。我有一个批处理文件,其中我正在使用“超时”功能,如下所示:
*code does some things*
timeout /t 100 rem wait for 100 seconds for the above thing to finish
如果我在命令行中执行timeout /t 100,它会像我预期的那样等待 100 秒。但是,在脚本中它给了我错误:
ERROR: Invalid syntax. Default option is not allowed more than '1' time(s).
Type "TIMEOUT /?" for usage.
timeout 的说明是 /t 等待秒数,/nobreak 忽略按键,/? 显示帮助消息。我不确定我遇到了什么语法错误,或者什么“不允许默认选项”,特别是因为它似乎在批处理文件之外工作得很好。
【问题讨论】:
标签: windows batch-file timeout