CSDN专家博客精华版

为人民服务!
  首页  :: 新随笔  :: 管理

A scripting for rebooting system

Posted on 2007-12-17 10:16  csdnexpert  阅读(144)  评论(0编辑  收藏  举报
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    
& "{impersonationLevel=impersonate,(Shutdown)}!\" & strComputer & " ootcimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
    (
"Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
    ObjOperatingSystem.Reboot()
Next


Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=458734