PDA

View Full Version : Script for a restart in 2000


neilt
05-17-2001, 08: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, 09: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, 08: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.

sami
06-17-2001, 03:54 PM
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, 05:12 PM
Thanks for the script, it worked well.

shafi
07-02-2001, 10:40 PM
what is source code win98 ? . it work on winxp .