Discussion Locked

Can Task Scheduler force a re-boot?

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is there anyway to set up task scheduler to re-boot the system at a specific time? We have a system that stays up 24-7 (part of time clock system). But resources run low and they don't reboot as often as they should. Any other possible way to do this?

4 replies

by mmccaskill69

Yes, it can be done.
You would need to create a batch file.
I created a batch file called restart.bat in ms-dos prompt.
At ms-dos prompt I typed edit restart.bat and entered.
I added this line,"rundll32.exe shell32.dll,SHExitWindowsEx (x)"
In the place of (x) you would put one of the following numbers: 2 = reboot
4 = Forced reboot (this is used in case there are certain programs that have to be closed before a restart).
Hold down ALT and press F, then press X.
Hit enter to save the changes.
This batch file works for me using Task Scheduler on a 98' system.
You will need to add, to the batch file, lines if you have a logon window that comes up after a restart so it will autologon, unless you use tweakui (if the system is 95' or 98').
The article, which you can find at www.microsoft.com/technet, is Q234216.
Good Luck!

by markspencer

Had to go to Microsoft to see formatting.
I was trying to put the number is ().
Got it to work - thanks!

by tudore

I'm using NT right now, so I can't test this out, but I'll try to check it tonight.

Make a shortcut wherever you please on your computer(maybe your desktop?). put this in as the shortcut's target:

C:\WINDOWS\RUNDLL.EXE user.exe,exitwindowsexec

All on one line.

then have task scheduler run the shortcut at a specific time. I haven't checked this, so there may be a problem with having to hit okay to shutdown. If that is the case, the above answer would be better.

This discussion is closed to new replies.