Sign in to follow this  
Followers 0
bourny

how to tell OS name / Type

3 posts in this topic

I am trying to find a way to tell what operating system the machine is.

The macros in AutoIt do not give me the information ... As an example the Windows 2000 pro and server have the same osbuild and number.

I would like to beable to output the name of the operating system e.g

Windows XP

windows 2000 professional

windows 2000 server

Windows 2003 Server

etc.

Does anyone know how I go about this ... I am at a loss from searching on the internet.

I know this can be done as I have an inventory program that does this but not sure how it manages it,

Many Thanks for any assistance.

Share this post


Link to post
Share on other sites

Hi,

$objWMIService = objget("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

$colSettings = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")

For $objOperatingSystem in $colSettings
    $Type = StringMid($objOperatingSystem.Caption, 19)
    ;$Serial = StringMid($objOperatingSystem.SerialNumber, 1)
    MsgBox(64, 'Ouput of Windows Type and Serial', "Type    : "& $Type); & @CRLF & "Serial    : " & $Serial)
Next

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Thanks.

This is exactly what I am looking for ... You have saved me a lot of grey hair with this script...

I need to get into object scripting - any good tutorials you can reccomend - is there a list of where this sort of information is stored. - I do scripting but not to this level yet.

Many Thanks

Hi,

$objWMIService = objget("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

$colSettings = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")

For $objOperatingSystem in $colSettings
    $Type = StringMid($objOperatingSystem.Caption, 19)
    ;$Serial = StringMid($objOperatingSystem.SerialNumber, 1)
    MsgBox(64, 'Ouput of Windows Type and Serial', "Type    : "& $Type); & @CRLF & "Serial    : " & $Serial)
Next

So long,

Mega

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  
Followers 0