我想创建一个等待直到上午11:00的vbscript,当它转动时,我希望它启动批处理脚本。我只知道如何使用
WScript.Sleep
但我想让它在某个时间运行。
答案 0 :(得分:0)
使用Now()
检查系统时间:
Dim time, WshShell
Set WshShell = CreateObject("WScript.Shell")
time = Now()
hm = Minute(time) + 100 * Hour(time)
' Only execute between 11:00AM and 11:30AM
While hm < 1100 Or hm > 1130
WScript.Sleep 2
Wend
' Do your job here
WshShell.Run "some.bat", , False