欢迎来到天天文库
浏览记录
ID:59434608
大小:178.00 KB
页数:47页
时间:2020-05-21
《VBS经典代码大全.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、VBS代码片断大全[一]1VBS取得本机IPstrComputer="."SetobjWMIService=GetObject("winmgmts:"&strComputer&"rootcimv2")SetIPConfigSet=objWMIService.ExecQuery("SelectIPAddressfromWin32_NetworkAdapterConfigurationWhereIPEnabled=TRUE")ForEachIPConfiginIPConfigSetIfNotIsNull(IPConfig.IPAdd
2、ress)ThenForEachstrAddressinIPConfig.IPAddressWScript.EchostrAddressNextEndIfNext--------------------------------------------------------------------------------2取得本机计算机名strComputer="."SetobjWMIService=GetObject("winmgmts:"&strComputer&"rootcimv2")SetcolComputers=obj
3、WMIService.ExecQuery("Select*fromWin32_ComputerSystem")ForEachobjComputerincolComputersWscript.EchoobjComputer.NameNext--------------------------------------------------------------------------------4检查升级包strComputer="."SetobjWMIService=GetObject("winmgmts:"&strCompute
4、r&"rootcimv2")SetcolOperatingSystems=objWMIService.ExecQuery("Select*fromWin32_OperatingSystem")ForEachobjOperatingSystemincolOperatingSystemsWscript.EchoobjOperatingSystem.ServicePackMajorVersion&"."&objOperatingSystem.ServicePackMinorVersionNext---------------------
5、-----------------------------------------------------------5检查HotFixstrComputer="."SetobjWMIService=GetObject("winmgmts:"&strComputer&"rootcimv2")SetcolQuickFixes=objWMIService.ExecQuery("Select*fromWin32_QuickFixEngineering")ForEachobjQuickFixincolQuickFixesWscript.
6、Echo"Description:"&objQuickFix.DescriptionWscript.Echo"HotFixID:"&objQuickFix.HotFixIDNext--------------------------------------------------------------------------------6检查本地管理员数目SetobjNetwork=CreateObject("Wscript.Network")strComputer=objNetwork.ComputerNameSetobjGrou
7、p=GetObject("WinNT://"&strComputer&"/Administrators,group")ForEachobjUserinobjGroup.MembersWscript.EchoobjUser.NameNext--------------------------------------------------------------------------------7磁盘系统strComputer="."SetobjWMIService=GetObject("winmgmts:"&strComputer
8、&"rootcimv2")SetcolDisks=objWMIService.ExecQuery("Select*fromWin32_LogicalDiskWhereDriveType=3")ForEachobjDi
此文档下载收益归作者所有