I'm trying to run a VBScript checking the time until it reaches 22:00 (10PM), and then runs shutdown.bat
. I always get errors such as "'loop' without 'do'". Can anyone look at my code and see if there's a way to fix it?
Do
If Hour(Time()) => 22 And Minute(Time()) => 30 And Hour(Time()) < 23 Then
Loop Until True
Then
'Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run "shutdown.bat"
Set shell = Nothing
End If
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…