Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520

    Unanswered: Here is a fun question

    I was asked by a buddy the other day about this so I thought I would pass on the quetion.
    He has a list of pc names (full path) on a windows network in a TXT file
    He wants his pc to connect to the pc's on the list and reboot them.

    Can this be done in VB ?
    or with DOS? I know it can be done in a DOS batch file as far as connecting to the other machine logging into it and rebooting it. it is the going through the list of 200 PC's that is an issue.
    Darasen

  2. #2
    Join Date
    May 2004
    Posts
    97
    I've never done this, but....

    Set a reference to the MS WMI Scripting, then,

    Code:
    Set OpSysSet = 
    GetObject("winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//$MACHINE_NAME 
    ").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
    for each OpSys in OpSysSet
    OpSys.Reboot()
    Next
    Right off of the MS Technet pages.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •