I got some code that i need to extend to include detection of vista windows 7 2008 etc and was wondering if anyone could give me some assistance.
basically i need to add detection of windows vista and 7 and possibly w2k8+ ....any ideas...have nfi btw... looking at snippets atm trying to solve....
'==========================================================================
'Determine OS using WMI
'==========================================================================
Dim sWXPP, sW2KP, sW2KS, sW2KAS, sW2KDS, sW2K3S, sW2K3W, sW2K3E, sUnkOS, sWbemOpSys
Dim oWbemServices
Dim cOperatingSystems
Dim oInstance
sWXPP = "Microsoft Windows XP Professional"
sW2KP = "Microsoft Windows 2000 Professional"
sW2KS = "Microsoft Windows 2000 Server"
sW2KAS = "Microsoft Windows 2000 Advanced Server"
sW2KDS = "Microsoft Windows 2000 Datacenter Server"
sW2K3S = "Microsoft(R) Windows(R) Server 2003, Standard Edition"
sW2K3W = "Microsoft(R) Windows(R) Server 2003, Web Edition"
sW2K3E = "Microsoft(R) Windows(R) Server 2003, Enterprise Edition"
sUnkOS = "OS Unknown or NOT supported"
Set oWbemServices = GetObject("winmgmts:")
Set cOperatingSystems = oWbemServices.InstancesOf("Win32_OperatingSystem")
On Error Resume Next
For Each oInstance in cOperatingSystems
sWbemOpSys = oInstance.Caption
If sWbemOpSys = "" Then
sWbemOpSys = sUnkOS
End If
Next
Select Case sWbemOpSys
Case sWXPP
Case sW2KP
Case sW2KS
Case sW2KAS
Case sW2KDS
Case sW2K3S
Case sW2K3W
Case sW2K3E
Case Else
sContent = sFJImg & "<h3><center>OS Not Supported:" _
& "<br><br>" & sWbemOpSys & "</center></h3>"
oDialogWindow.document.body.innerHTML = sContent
WScript.Sleep 1000
oDialogWindow.Quit
WScript.Quit
End Select
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Hi Guys,
I got some code that i need to extend to include detection of vista windows 7 2008 etc and was wondering if anyone could give me some assistance.
basically i need to add detection of windows vista and 7 and possibly w2k8+ ....any ideas...have nfi btw... looking at snippets atm trying to solve....
Share this post
Link to post
Share on other sites