Jump to content

Recommended Posts

Posted

Hi All,

is there a way to retrieve the windows version like displayed in ControlPanel/System

for example

Windows 2000 Professional/Server/Advanced Server

Windows XP Home/Professional/Media Center Edition

Windows Vista Home Basic/Home Premium/Business/Ultimate

Windows 2003 Web/Standard/Enterprise/Datacenter

Thnx

Emiel

Best regards,Emiel Wieldraaijer

Posted

Hi Zedna,

thnx

but it does not retrieve the information i want .. or i have the wrong version of it .. there are also some errors in the script .. not all information is retrieved correctly ..

Emiel

Best regards,Emiel Wieldraaijer

Posted

You can get that info from WMI.

CODE
dim $strData

$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & "localhost" & "\root\cimv2")

$colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_OperatingSystem")

For $objItem in $colItems

$strData = $strData & "Caption - " & $objitem.Caption & @crlf

$strData = $strData & "BuildNumber - " & $objitem.BuildNumber & @crlf

$strData = $strData & "CSDVersion - " & $objitem.CSDVersion & @crlf

$strData = $strData & "Version - " & $objitem.Version & @crlf

Next

msgbox(0,"Results",$strData)

I believe they translate the build and ver number into version 200X on the System Info applet. Hope that helps.

Posted (edited)

@spudw2k and @zedna

Thnx for the example ..

but when i look at http://msdn2.microsoft.com/en-us/library/aa394239.aspx

i'll have to use the OperatingSystemSKU

but i get the following error message "The requested action with this object has failed."

These option is left out of the compinfo udf maybe for the same reason ..

[edit]aha i see "Windows Server 2003, Windows XP, Windows 2000, and Windows NT 4.0 not supported" so will work only in vista..[/edit]

Emiel

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...