bourny Posted January 8, 2008 Share Posted January 8, 2008 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. Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 8, 2008 Share Posted January 8, 2008 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 Link to comment Share on other sites More sharing options...
bourny Posted January 11, 2008 Author Share Posted January 11, 2008 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now