Sql 获取WIndows的英文名称?

Sql 获取WIndows的英文名称?,sql,vbscript,createobject,Sql,Vbscript,Createobject,我正在使用以下VBScript检索Windows名称 Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime") strComputer = "." Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set oss = objWMIServic

我正在使用以下VBScript检索Windows名称

Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set oss = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

For Each os in oss
    msgbox os.Caption
    exit for
Next
它回来了

Microsoft Windows Edition家庭高级版


如果系统语言不是英语,则返回特定系统语言。我想知道的是,尽管系统语言不同,但要获得始终以英语显示的Windows名称,VBScript代码是什么?

也许您可以使用
操作系统ku
而不是
标题

根据中的列表,您可以使用以下命令获得变体类型。但是,要构建操作系统版本(
OS.Version
OS.BuildNumber
),您需要更多信息,请参阅


您是否尝试在名称空间限定符中传递US English的区域设置ID?我相信美国英语是1033(0409),所以它看起来是这样的:
GetObject(“winmgmts:\\.\root\cimv2\ms\u 409”)
谢谢,但不幸的是,这不起作用。看起来你已经找到了解决方案,但我很好奇,如果写下它,它是否会返回正确的标题:
GetObject(“winmgmts:{impersonationLevel=impersonate}[locale=ms\u 409]!\\“&strComputer&“\root\cimv2”)
。这对我来说是可行的,但我目前没有使用非英语语言,因此您的结果可能不同。它以特定的系统语言返回。
Set oDict = CreateObject("Scripting.Dictionary")
oDict.Add 0,    "An unknown product"
oDict.Add 1,    "Ultimate"
oDict.Add 2,    "Home Basic"
oDict.Add 3,    "Home Premium"
oDict.Add 4,    "Enterprise"
oDict.Add 5,    "Home Basic N"
oDict.Add 6,    "Business"
oDict.Add 7,    "Server Standard"
oDict.Add 8,    "Server Datacenter (full installation)"
oDict.Add 9,    "Windows Small Business Server"
oDict.Add 10,   "Server Enterprise (full installation)"
oDict.Add 11,   "Starter"
oDict.Add 12,   "Server Datacenter (core installation)"
oDict.Add 13,   "Server Standard (core installation)"
oDict.Add 14,   "Server Enterprise (core installation)"
oDict.Add 15,   "Server Enterprise for Itanium-based Systems"
oDict.Add 16,   "Business N"
oDict.Add 17,   "Web Server (full installation)"
oDict.Add 18,   "HPC Edition"
oDict.Add 19,   "Windows Storage Server 2008 R2 Essentials"
oDict.Add 20,   "Storage Server Express"
oDict.Add 21,   "Storage Server Standard"
oDict.Add 22,   "Storage Server Workgroup"
oDict.Add 23,   "Storage Server Enterprise"
oDict.Add 24,   "Windows Server 2008 for Windows Essential Server Solutions"
oDict.Add 25,   "Small Business Server Premium"
oDict.Add 26,   "Home Premium N"
oDict.Add 27,   "Enterprise N"
oDict.Add 28,   "Ultimate N"
oDict.Add 29,   "Web Server (core installation)"
oDict.Add 30,   "Windows Essential Business Server Management Server"
oDict.Add 31,   "Windows Essential Business Server Security Server"
oDict.Add 32,   "Windows Essential Business Server Messaging Server"
oDict.Add 33,   "Server Foundation"
oDict.Add 34,   "Windows Home Server 2011"
oDict.Add 35,   "Windows Server 2008 without Hyper-V for Windows Essential Server Solutions"
oDict.Add 36,   "Server Standard without Hyper-V"
oDict.Add 37,   "Server Datacenter without Hyper-V (full installation)"
oDict.Add 38,   "Server Enterprise without Hyper-V (full installation)"
oDict.Add 39,   "Server Datacenter without Hyper-V (core installation)"
oDict.Add 40,   "Server Standard without Hyper-V (core installation)"
oDict.Add 41,   "Server Enterprise without Hyper-V (core installation)"
oDict.Add 42,   "Microsoft Hyper-V Server"
oDict.Add 43,   "Storage Server Express (core installation)"
oDict.Add 44,   "Storage Server Standard (core installation)"
oDict.Add 45,   "Storage Server Workgroup (core installation)"
oDict.Add 46,   "Storage Server Enterprise (core installation)"
oDict.Add 47,   "Starter N"
oDict.Add 48,   "Professional"
oDict.Add 49,   "Professional N"
oDict.Add 50,   "Windows Small Business Server 2011 Essentials"
oDict.Add 51,   "Server For SB Solutions"
oDict.Add 52,   "Server Solutions Premium"
oDict.Add 53,   "Server Solutions Premium (core installation)"
oDict.Add 54,   "Server For SB Solutions EM"
oDict.Add 55,   "Server For SB Solutions EM"
oDict.Add 56,   "Windows MultiPoint Server"
oDict.Add 59,   "Windows Essential Server Solution Management"
oDict.Add 60,   "Windows Essential Server Solution Additional"
oDict.Add 61,   "Windows Essential Server Solution Management SVC"
oDict.Add 62,   "Windows Essential Server Solution Additional SVC"
oDict.Add 63,   "Small Business Server Premium (core installation)"
oDict.Add 64,   "Server Hyper Core V"
oDict.Add 66,   "Starter E"
oDict.Add 67,   "Home Basic E"
oDict.Add 68,   "Home Premium E"
oDict.Add 69,   "Professional E"
oDict.Add 70,   "Enterprise E"
oDict.Add 71,   "Ultimate E"
oDict.Add 72,   "Server Enterprise (evaluation installation)"
oDict.Add 76,   "Windows MultiPoint Server Standard (full installation)"
oDict.Add 77,   "Windows MultiPoint Server Premium (full installation)"
oDict.Add 79,   "Server Standard (evaluation installation)"
oDict.Add 80,   "Server Datacenter (evaluation installation)"
oDict.Add 84,   "Enterprise N (evaluation installation)"
oDict.Add 95,   "Storage Server Workgroup (evaluation installation)"
oDict.Add 96,   "Storage Server Standard (evaluation installation)"
oDict.Add 98,   "Windows 8 N"
oDict.Add 99,   "Windows 8 China"
oDict.Add 100,  "Windows 8 Single Language"
oDict.Add 101,  "Windows 8"
oDict.Add 103,  "Professional with Media Center"

Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set oss = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")

For Each os in oss
    sType = oDict.Item(os.OperatingSystemSKU)
Next

Wscript.Echo "OS Type: " & sType