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
博客展示了一段脚本代码,通过获取Windows系统的WMI服务,查询操作系统信息,然后对每个操作系统对象执行重启操作,实现了Windows系统的重启功能。
1968

被折叠的 条评论
为什么被折叠?



