View Full Version : Script for a restart in 2000
neilt
05-17-2001, 09:31 PM
Does anyone have a script to restart Windows 2000? I plan on calling this script to restart our print server automatically. I tried the usual RUNDLL32.EXE, USER32.DLL,ExitWindowsEx 2, but that didn't work.
Thanks
RWSchlatter
05-17-2001, 10:01 PM
policy settings for the user, that the script is running under, have to allow shutdown / booting. Is that the case?
______________
Regards - Richard
neilt
05-21-2001, 09:34 PM
The problem isn't user access, but that the common restart command for Win 98 doesn't work on 2000, and I haven't seen anywhere that has the right command.
Try This:
'Restart computer
Dim OpSysSet, OpSys
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
For Each OpSys In OpSysSet
OpSys.Reboot()
Next
WScript.Quit
neilt
06-22-2001, 06:12 PM
Thanks for the script, it worked well.
shafi
07-02-2001, 11:40 PM
what is source code win98 ? . it work on winxp .
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.