用于查找 Windows 版本名称和服务包的 vbscript [英] A vbscript to find windows version name and the service pack
问题描述
找出在装有 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 XP
和 Service Pack 3
.
For example I'd want to know Windows XP
and Service Pack 3
.
推荐答案
一个简单的方法是使用 WMI 类 Win32_OperatingSystem 具有属性 ServicePackMajorVersion
、ServicePackMinorVersion
、Name
和 Version
.您可以在此处找到示例: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屋!