首页 电脑 电脑学堂 查看内容

VBS检索已安装的操作系统的名称

2009-10-30 10:15 663 0

摘要: Const ForReading = 1Set objFSO = CreateObject("Scripting.FileSystemObject")Set objTextFile = objFSO....
关键词: 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
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部