Forum Home
Press F1
 
Thread ID: 28371 2002-12-17 20:18:00 How do I schedule a restart? FzerozeroT (1253) Press F1
Post ID Timestamp Content User
106995 2002-12-17 20:18:00 How do I schedule a restart on XP Professional, can it be done?
Is there a file with a command anywhere that will restart a computer?

This is for a small business server that I want to fully automate.

Thanks anyone
FzerozeroT (1253)
106996 2002-12-17 20:26:00 I know that on a 98 boot disk there is a file called restart, might work in xp underr compatibilty mode perhaps, but HoneyLaser or SiK have previously reccommended some software that does just that I think :)

On the 98 boot disk, the file is called restart and it does just that, restarts it.

There's also a /switch you can use on the command.com file or something similar from what I understand. Otherwise, there's Autodown.exe, I think its available on the PCWorld site if you search for Autodown, and it lets you specify a time to close down your PC! (Shutdown, not restart).

Hope this helps


Chilling_Silence
Chilling_Silence (9)
106997 2002-12-17 20:43:00 Copy and paste this script into a file and call it reboot.vbs (or whatever you like.vbs)


'Restart the PC for Windows XP/2k
set wmi = getobject("winmgmts:{(Shutdown)}")
set objset = wmi.instancesof("win32_operatingsystem")
for each obj in objset
set os = obj : exit for
next
'Create the number below by adding LOGOFF = 0, SHUTDOWN = 1, REBOOT = 2, FORCE = 4, POWEROFF = 8
os.win32shutdown 2


For the last line the 2 can be changed as it says for different actions.
Then all you need to do is create a scheduled task to run this file when you want.
CYaBro (73)
106998 2002-12-17 21:10:00 Does that just go into notepad then save with different extension?
I don't have visual basic
FzerozeroT (1253)
106999 2002-12-17 21:16:00 Yes.. And that's a much better solution that what I'd origionally said.

Save it in notepad, but make sure that you remove the .txt extension and replace it with .vbs!
Chilling_Silence (9)
107000 2002-12-17 21:35:00 Yea Sorry! :(

Forgot that part. Right-click desktop then New - Text Document. Then give a name making sure that the .txt is now .vbs.

You probably will have to have change your settings though to show extensions for known file types.

This is done in any Windows Explorer window. Click Tools menu then Folder Options then View tab. Then uncheck box for 'Hide file extensions for known file types'

Hope this helps!

Cya
CYaBro (73)
107001 2002-12-17 21:45:00 Cyabro, another question,

is ansi format ok for that notepad doc?
FzerozeroT (1253)
107002 2002-12-17 21:49:00 Yup! Should be fine. Chilling_Silence (9)
107003 2002-12-17 22:03:00 Yes, Chilling Silence is right. ANSI is all good! CYaBro (73)
1