Chimaera Posted May 10, 2012 Posted May 10, 2012 (edited) Hi allI made an OS function for something im working on like thisConsoleWrite(_OS()) MsgBox(64, "Test", _OS()) Func _OS() Local $OS Local $objWMIService = ObjGet("winmgmts:localhostrootCIMV2") Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL") If IsObj($colItems) Then For $objItem In $colItems $OS = $objItem.Caption & " / " & $objItem.OSArchitecture & " / " & $objItem.CSDVersion & @CRLF Return $OS Next EndIf EndFunc ;==>_OSBut on any XP machine it fails??Its fine on vista and aboveI thought scriptomatic was for xp as well, and the other 6 or so other functions i made are fine all except this one.Have i done something wrong or just an anomolie?It fails on the line before this Func _OS() with Error the requested action with this object has failed Edited May 10, 2012 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
JScript Posted May 10, 2012 Posted May 10, 2012 (edited) Hi!OSArchitectureWindows Server 2003, Windows 2000, Windows NT 4.0, Windows XP, and Windows Me/98/95: This property is not available.Font: http://msdn.microsoft.com/en-us/library/windows/desktop/aa394239%28v=vs.85%29.aspxRegards,João Carlos. Edited May 10, 2012 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
JScript Posted May 12, 2012 Posted May 12, 2012 @ChimaeraThe information that I posted solves? http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Chimaera Posted May 12, 2012 Author Posted May 12, 2012 Sorry M8 yes it does i had to mod the function like this to solve it Func _OS() Local $OS, $sArchTest If @OSArch = "X86" Then $sArchTest = "32-Bit" Else $sArchTest = "64-Bit" EndIf Local $objWMIService = ObjGet("winmgmts:localhostrootCIMV2") Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL") If IsObj($colItems) Then For $objItem In $colItems $OS = $objItem.Caption & " / " & $sArchTest & " / " & $objItem.CSDVersion & @CRLF Return $OS Next EndIf EndFunc ;==>_OS If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices()
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