| 关键词: strComputer objWMIService objTextFile ForReading colItems objItem strText objFSO Set Each |
Const ForReading = 1Set objFSO = CreateObject("Scripting.FileSystemObject")Set objTextFile = objFSO.OpenTextFile _ ("c:\scripts\servers.txt", ForReading)strText = objTextFile.ReadAllobjTextFile.ClosearrComputers = Split(strText, vbCrLf)For Each strComputer in arrComputers Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * From Win32_OperatingSystem") For Each objItem in ColItems Wscript.Echo strComputer & ": " & objItem.Caption NextNext |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|