What's wrong with the script I've created below? At 1:50 PM it will not go to the Reboot label ...
Wait>5
Label>Start
GetTime>
Hour>Hour
Min>Minutes
If>Hour=1 and If>Minutes=50,Reboot
Goto>Start
Label>Reboot
ShutDownWindows>1
How to reboot PC based on time of day?
Moderators: Dorian (MJT support), JRL
Re: How to reboot PC based on time of day?
[quote="jwimer"]What's wrong with the script I've created below? At 1:50 PM it will not go to the Reboot label ...
Wait>5
Label>Start
Hour>Hour
Min>Minutes
If>Hour=1 and If>Minutes=50,Reboot
Goto>Start
Label>Reboot
ShutDownWindows>1
[/quote]
Wait>5
Label>Start
Hour>Hour
Min>Minutes
If>Hour=1 and If>Minutes=50,Reboot
Goto>Start
Label>Reboot
ShutDownWindows>1
[/quote]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
This is your original script that does not work:
This will loop continuously, and check for 13:50 every 5 seconds.
Need to move Wait>5 inside Start in order to loop contnuously.
Time format is based on your system settings. My system hours are based on 24 hour clock, so need to check for 13 to get 1PM.
Another thought....it might be easier to just make a single line macro like this:
Be sure to remove any Trailing Space Characters from each line.
You cannot combine IF> on same line. Need to do something like this:Wait>5
Label>Start
Hour>Hour
Min>Minutes
If>Hour=1 and If>Minutes=50,Reboot
Goto>Start
Label>Reboot
ShutDownWindows>1
Label>Start
Wait>5
Hour>Hour
Min>Minutes
If>%Hour%13,Start
If>%Minutes%=50,Reboot,Start
Label>Reboot
ShutDownWindows>1
This will loop continuously, and check for 13:50 every 5 seconds.
Need to move Wait>5 inside Start in order to loop contnuously.
Time format is based on your system settings. My system hours are based on 24 hour clock, so need to check for 13 to get 1PM.
Another thought....it might be easier to just make a single line macro like this:
and have it scheduled to run at 1:50 PM.ShutDownWindows>1
Be sure to remove any Trailing Space Characters from each line.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Thanks for all replies.
Bob, I'll use the revised script that you suggested.
I actually am going to set up the script to cause a reboot every six hours. Your example has shown me how to do it.
I'm managing a remote PC that is in the lobby of a building that runs a PowerPoint slide show 24/7 and I'm setting up a periodic reboot to refresh its network connection, etc.
One more question please: Where do I go in Windows 2000 to change the system clock from 12 to 24 hour format?
Bob, I'll use the revised script that you suggested.
I actually am going to set up the script to cause a reboot every six hours. Your example has shown me how to do it.
I'm managing a remote PC that is in the lobby of a building that runs a PowerPoint slide show 24/7 and I'm setting up a periodic reboot to refresh its network connection, etc.
One more question please: Where do I go in Windows 2000 to change the system clock from 12 to 24 hour format?