重启Windows系统

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'功能:重起PC
'版权所有:Badboy QQ:383088680 MSN:hahazhu0634@live.cn
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate,(Shutdown)}!\\" & strComputer &
"\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
    ObjOperatingSystem.Reboot()
Next
 
重启系统的小软件很多,我这是以前用WMI写的,简单易用.这是我以前用来定时重启服务器的.哈哈!


本文转自hahazhu0634 51CTO博客,原文链接:http://blog.51cto.com/5ydycm/115411,如需转载请自行联系原作者
上一篇:API网关具备自动生成多语言SDK的能力


下一篇:API网关为K8s容器应用集群提供强大的接入能力