我要达到的目的是每周不同时间段执行不同的程序SWITCH case to语句
然后我在这个语句最外面价格了循环语句的嵌套,FOR TO STEP 这样可以让这个语句循环执行
我不知道在SWITCH语句外面是否可以嵌套 FOR语句,麻烦告诉一下,谢谢
For $i=3 To 1 Step -1
Switch @WDAY
Case 2 To 2 ;周一
Switch @HOUR
Case 0 To 6
RunWait("run0.exe")
Case 7 To 10
RunWait("run1.exe")
Case 11 To 12
RunWait("run2.exe")
Case 13 To 17
RunWait("run1.exe")
Case 18 To 21
RunWait("run2.exe")
Case 22 To 23
RunWait("run0.exe")
EndSwitch
Case 3 To 3 ;周二
Switch @HOUR
Case 0 To 6
RunWait("run0.exe")
Case 7 To 10
RunWait("run1.exe")
Case 11 To 12
RunWait("run2.exe")
Case 13 To 17
RunWait("run1.exe")
Case 18 To 21
RunWait("run2.exe")
Case 22 To 23
RunWait("run0.exe")
EndSwitch
Case 4 To 4 ;周三
Switch @HOUR
Case 0 To 6
RunWait("run0.exe")
Case 7 To 10
RunWait("run1.exe")
Case 11 To 12
RunWait("run2.exe")
Case 13 To 17
RunWait("run1.exe")
Case 18 To 21
RunWait("run2.exe")
Case 22 To 23
RunWait("run0.exe")
EndSwitch
Case 5 To 5 ;周四
Switch @HOUR
Case 0 To 6
RunWait("run0.exe")
Case 7 To 10
RunWait("run1.exe")
Case 11 To 12
RunWait("run2.exe")
Case 13 To 17
RunWait("run1.exe")
Case 18 To 21
RunWait("run2.exe")
Case 22 To 23
RunWait("run0.exe")
EndSwitch
Case 6 To 6 ;周五
Switch @HOUR
Case 0 To 6
RunWait("run0.exe")
Case 7 To 10
RunWait("run1.exe")
Case 11 To 12
RunWait("run2.exe")
Case 13 To 17
RunWait("run1.exe")
Case 18 To 23
RunWait("run2.exe")
EndSwitch
Case 7 To 7 ;周六
Switch @HOUR
Case 0 To 6
RunWait("run1.exe")
Case 7 To 9
RunWait("run0.exe")
Case 10 To 16
RunWait("run2.exe")
Case 17 To 18
RunWait("run1.exe")
Case 19 To 23
RunWait("run2.exe")
EndSwitch
Case 1 To 1 ;周日
Switch @HOUR
Case 0 To 6
RunWait("run1.exe")
Case 7 To 8
RunWait("run0.exe")
Case 9 To 9
RunWait("run1.exe")
Case 10 To 16
RunWait("run2.exe")
Case 17 To 18
RunWait("run0.exe")
Case 19 To 21
RunWait("run2.exe")
Case 22 To 23
RunWait("run0.exe")
EndSwitch
EndSwitch
Next
Shutdown(6)