I know this is probably very easy, but can someone tell me how to schedule an automatic reboot of the server for, say, every Sunday afternoon (when we're closed)?
Okay, I think I understand. I create a batch file with "shutdown /L /R /Y /C" in it and call it reboot.cmd (or something else). But, I'm not sure what the AT command would be to run that batch file every Sunday or if possible, actually, just the first Sunday of every month?
Okay, I've played with this on my own XP PC and it basically works. However, it only seems to like the command "shutdown /L /R". If I add the /Y /C it won't run. Do you think it's because I'm on XP. Maybe on the server it will need the /Y /C. But I can't play with the server right now.
Okay, I set the reboot.cmd to run at 8:00 this morning. Now, here's a stupid question. How can I tell whether the server actually rebooted. Is it in the event viewer or something? I know the task ran but that doesn't necessarily mean that the reboot happened successfully. Thanks.
You can also get the psuptime.exe utility from the same sysinternals site and run it in the morning. It will tell you how long your system has been up.
Thanks for that info. I used systeminfo from the command prompt and sure enough the server has been up and running for 7 days+ so the daily restarts I've been trying obviously are not happening. It works on my XP machine but not on the 2003 server. So, I must have something wrong in the batch file.
Yeah, that's what I was thinking. Monday morning which is a good time for me to play around with the server I am going to run the batch file manually and see what pops up. If it reboots no problem, then I'm thinking it might be because the server is locked once the screen saver comes on which I read about here: (
Make sure the task scheduler is running on an account that has enough rights to run the commands you're using in the .cmd file. Usually the scheduler runs under the system account which should be ok.
another thing you can try it to set a delay in the command so it waits like 300 seconds. I think the switch may be /t. Anyway, once you prove it works, just do a shutdown /a, which will abort the command.
Okay. This morning I ran the reboot.cmd manually which contains only "shutdown /r". And the system rebooted. So I set up the task to run that command at 8:00 tomorrow morning. I was logged in as the administrator and entered the password twice when prompted by the task scheduler so we'll see what happens tomorrow morning.
The task is run by a user with domain admin rights, and the job runs successfully on about 15 of our servers, daily.
You can tell whether it was successful by opening up task scheduler and scrolling to the right and checking the code under Last Result. 0x0 means it was successful.
Okay. First thing this morning at 9:00 I checked systeminfo at the command prompt and the server had been up and running for 23 hours so it did not reboot at 8:00 this morning. Even though the task scheduler says it ran at 8:00 and will run again at 8:00 tomorrow morning. In the last result the info is 0x4f7 (whatever that means) not 0x0. Then at about 9:05 the server did reboot. I think it could not run the command 8:00 because the server was locked until I came in at 9:00 and did Ctrl-Alt-Del and entered the password. This was supposed to be fixed in SP1 I thought.
In the task scheduler, click the 'advanced" button and view the log. This will give you more detail about what happened to the job. What account was the task scheduled under? Was it the default of system?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.