Jump to content
Sign in to follow this  
am632

How do I get OS Version?

Recommended Posts

am632

Hi, If I have the following....

MsgBox(0,"",@OSVersion)

I get a return of 'WIN_7' but How can I get the message box to say either 'Home Premium' or 'Ultimate' etc. I need the full windows version for 7.

thanks

Share this post


Link to post
Share on other sites
sleepydvdr

You will need to read the following key in the registry:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites
Zedna

There are Windows API functions for this

Syntax for PowerBuilder:

Function Boolean GetVersionEx (Ref OSVERSIONINFOEX lpVersionInformation) Library "kernel32.dll" Alias For "GetVersionExA"
Function Boolean GetProductInfo (ulong dwOSMajorVersion, ulong dwOSMinorVersion, ulong dwSpMajorVersion, ulong dwSpMinorVersion, Ref ulong pdwReturnedProductType) Library "kernel32.dll"

Search this forum for example for these functions.

Share this post


Link to post
Share on other sites
taietel

Or this?

$colItems = ""
$Output=""
$objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", 0x30)

If IsObj($colItems) then
   For $objItem In $colItems
      $Output = $objItem.Caption & " " & $objItem.Version & @CRLF
      if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop
      $Output=""
   Next
Else
   Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_OperatingSystem" )
Endif

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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.