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