WMI脚本查询的几种写法
推荐个工具WMICodeCreator ,另外还有一个windows自带的wmi测试工具wbemtest.exe
strComputer="." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") 'Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objOSInfo = objWMIService.ExecQuery("Select ServicePackMajorVersion,Version,OSType FROM Win32_OperatingSystem") '或 set owmiserver=GetObject("Winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration") '或 For Each colOSInfo In objOSInfo intCurrentSP = colOSInfo.ServicePackMajorVersion 'sp安全补丁版本 intOSver = colOSInfo.Version '操作系统版本号 intOStype = colOSInfo.OSType '操作系统类型 Next
上一篇: SQL精确通配查询的一个问题
下一篇: 远程连接wmi服务器
对不起,这篇文章暂时关闭评论。