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