用于查找 Windows 版本名称和服务包的 vbscript [英] A vbscript to find windows version name and the service pack

查看:23
本文介绍了用于查找 Windows 版本名称和服务包的 vbscript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

找出在装有 VBScript 的计算机上运行的 Windows 版本和服务包的最简单方法是什么?

What's the simplest way to find out which version of Windows, and which service pack, is running on a computer with VBScript?

例如我想知道 Windows XPService Pack 3.

For example I'd want to know Windows XP and Service Pack 3.

推荐答案

一个简单的方法是使用 WMI 类 Win32_OperatingSystem 具有属性 ServicePackMajorVersionServicePackMinorVersionNameVersion.您可以在此处找到示例:WMI 任务:操作系统

An easy way of doing this is to use the WMI class Win32_OperatingSystem which has the properties ServicePackMajorVersion, ServicePackMinorVersion, Name and Version. You can find samples here: WMI Tasks: Operating Systems

您返回的数据可能不是您想要的确切格式,因此您可能需要某种查找表以使其看起来完全正确.

The data you get back might not be in the exact format that you want though so you might need to have some kind of lookup table to make it look exactly right.

这篇关于用于查找 Windows 版本名称和服务包的 vbscript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆