Re: Reboot script

From: Soo Kuan Teo [MS] (sookuant_at_online.microsoft.com)
Date: 05/10/04

  • Next message: Emmet Gray: "Browswer from WMI Tools won't work after rename of PC"
    Date: Mon, 10 May 2004 10:37:53 -0700
    
    

    The following will reboot local computer. Please save it as vbs file:
    To use it, in a command shell, type
    cscript YourFileName.vbs
    thanks
    Soo Kuan

    Set OpSysSet =
    GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from
    Win32_OperatingSystem where Primary=true")
    for each OpSys in OpSysSet
     OpSys.Reboot()
    next

    -- 
    This posting is provided "AS IS" with no warranties, and confers no rights
    "Mike Potter" <anonymous@discussions.microsoft.com> wrote in message
    news:996001c433dc$2ee8ffe0$a601280a@phx.gbl...
    > I hope that this is right group to ask. I have xp pro and
    > I would like to have the computer automatically reboot at
    > a user specified time. I'm not sure how to do this. I
    > heard that I could download a pre-written script file to
    > notepad and name it and run from task manager. Can
    > someone tell me if this is true and if so what site or
    > resourse I could go to for instructions.
    > Thanks
    

  • Next message: Emmet Gray: "Browswer from WMI Tools won't work after rename of PC"