Automatic Reboot

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I am going to build a game server that will run at a remote location.

How do I schedule my server to automatically reboot itself at the same time
everyday?
 
Use this code, copy and paste it into a text file and name the file
shutdown.vbs. Then just schedule a task to run the file.

Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Const EWX_POWEROFF = 8

Set wmi = GetObject("winmgmts:{(Shutdown)}")

set objset = wmi.instancesof("win32_operatingsystem")

for each obj in objset
set os = obj : exit For
next

'===
' uncomment whichever you want to use...
'===
'os.shutdown
'os.reboot
' this one will do a *power off* (change EWX_POWEROFF
' with any of the other Const if needed
os.win32shutdown EWX_POWEROFF
 
Oops........... sorry my last post was to shutdown, you wanted reboot. Try
this, make a shortcut and point it to here:
%windir%\System32\SHUTDOWN.exe -r -t 05 -c "Windows will restart in 5
seconds. Close any open programs."

Then schedule a task to run the shortcut daily. You'll need windows setup to
autologon as well:
Start, run, type in: control userpasswords2, hit enter.

Uncheck: users must enter a user name and password to use this computer.

Xp will then ask you to enter the user and password you want to auto-logon
to.



Or



Download and install tweakui for xp and use its auto-logon feature.

http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Way to schedule restarts? 3
XP scheduled reboot 4
Can't move desktop icons until reboot 5
Access Making a memo in Access 0
WiFi Shuts Down 11
How do I start VPN at bootup and ensure that it keeps running? 3
Word Word "auto print" 2
Windows 7 Problem with Services 4

Back
Top