Jump to content

Computer Info UDF's


 Share

Recommended Posts

I am sorry. Slight oversight on my part. I had that variable from above in my script. I have added it to the function.

Func _ComputerGetUsers(ByRef $Usernames)
    Local $Usernames[1], $cI_Compname = @ComputerName
    Local $i = 1
    $oMyError = ObjEvent("AutoIt.Error", "ComError")
    Local $objDomain = ObjGet("WinNT://" & $cI_Compname & "" )
    Dim $filter[2] = ["user"]
    $objDomain.Filter = $filter
    For $aUser In $objDomain
        ReDim $Usernames[UBound($Usernames) + 1]
        $Usernames[$i] = $aUSer.Name
        $i += 1
    Next
    
    $Usernames[0] = UBound($Usernames) - 1
EndFunc

I hope that helps. (Updating first post with changes).

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Interesting processor data (sorry, but I simply ripped them out of my WoodUniqueID function and have no time to format it ont a UDF)

Func _ProcessorDataExtended($com = "localhost")
   $objWMIService = ObjGet ("winmgmts:\\" & $com & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_Processor", "WQL", 0x10 + 0x20)
    If IsObj ($colItems) Then
        For $objItem In $colItems
;;;DO SOMETHING WITH ALL THESE VALUES!!!
            $objItem.AddressWidth
            $objItem.Architecture
            $objItem.Caption
            $objItem.ConfigManagerErrorCode
            $objItem.ConfigManagerUserConfig
            $objItem.DataWidth
            $objItem.Description
            $objItem.DeviceID
            $objItem.ExtClock
            $objItem.Family
            $objItem.InstallDate
            $objItem.L2CacheSize
            $objItem.L2CacheSpeed
            $objItem.Level
            $objItem.Manufacturer
            $objItem.MaxClockSpeed
            $objItem.Name
            $objItem.OtherFamilyDescription
            $objItem.PNPDeviceID
            $objItem.ProcessorId
            $objItem.ProcessorType
            $objItem.Revision
            $objItem.Role
            $objItem.SocketDesignation
            $objItem.SystemCreationClassName
            $objItem.SystemName
            $objItem.UniqueId
            $objItem.UpgradeMethod
            $objItem.Version
            $objItem.VoltageCaps
        Next
    Else
        Return 0
    EndIf
EndFunc

Just me little (incomplete) contribution.

#)

Link to comment
Share on other sites

If anyone has any more ideas please let me know. I am trying to make this into quite a computer info library!

I will be working on documentation ASAP. I know they are a bit primitive at this point due to no documentation, but they work.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Works great, and can I incorporate these UDF's into my computer details program? V3 is still under construction.

You most certainly can. Please use the most up to date versions of the UDF's. (Like the ones that will include documentation soon).

Thanks for choosing to use them,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Interesting processor data (sorry, but I simply ripped them out of my WoodUniqueID function and have no time to format it ont a UDF)

Func _ProcessorDataExtended($com = "localhost")
   $objWMIService = ObjGet ("winmgmts:\\" & $com & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_Processor", "WQL", 0x10 + 0x20)
    If IsObj ($colItems) Then
        For $objItem In $colItems
;;;DO SOMETHING WITH ALL THESE VALUES!!!
            $objItem.AddressWidth
            $objItem.Architecture
            $objItem.Caption
            $objItem.ConfigManagerErrorCode
            $objItem.ConfigManagerUserConfig
            $objItem.DataWidth
            $objItem.Description
            $objItem.DeviceID
            $objItem.ExtClock
            $objItem.Family
            $objItem.InstallDate
            $objItem.L2CacheSize
            $objItem.L2CacheSpeed
            $objItem.Level
            $objItem.Manufacturer
            $objItem.MaxClockSpeed
            $objItem.Name
            $objItem.OtherFamilyDescription
            $objItem.PNPDeviceID
            $objItem.ProcessorId
            $objItem.ProcessorType
            $objItem.Revision
            $objItem.Role
            $objItem.SocketDesignation
            $objItem.SystemCreationClassName
            $objItem.SystemName
            $objItem.UniqueId
            $objItem.UpgradeMethod
            $objItem.Version
            $objItem.VoltageCaps
        Next
    Else
        Return 0
    EndIf
EndFunc

Just me little (incomplete) contribution.

#)

Thanks for the contribution. I think I may need to add an ability to get all this extra information per processor, if wanted. Such as _ComputerGetCPUs(ByRef $aCPUInfo[, $bCPUExtended]) the $bCPUExtended would allow the returned array to contain all of the extra information that is provided.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Added _ComputerGetGroups

It returns all the groups on a computer.

Thank you for everyone's input. I will be using the AutoIt Scriptomatic to get more _ComputerGet*Info* UDF's.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Updated _ComputerGet Printers/Groups with documentation and error checking.

See first Post!

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Changed _ComputerGetUsers to include more information. Updated _ComputerGetUsers with documentation and error checking.

Please let me know if you have any errors or can generate any problems with my code. I am very limited when it comes to error checking. I am trying to get better, and watch for all errors. I will be adding COM error checking at some point in the future.

Thanks again to everyone! Especially SvenP for Scriptomatic. It has made my UDF scripting really easy.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Any ideas or comments on the following?

_ComputerGetProcesses ;More indepth information than AutoIt's ProcessList()

_ComputerGetServices ;List services with information.

_ComputerGetThreads ;Along the same lines as _ComputerGetProcesses but has information on each individual thread.

_ComputerGetShares ;Gets all the shared objects on your computer.

_ComputerGetOS ;Returns extensive Operating System information

_ComputerGetBIOS ;Returns information on computer BIOS

_ComputerGet*Hardware*

Would you like to see the above scripted and added?

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Changed_ComputerGetStartup to include more information. Updated _ComputerGetStartup with documentation and error checking.

If anyone knows how to work with COM errors please let me know. I need some help in that area. With me converting most of these _ComputerGet*Info* UDF's to WMI script I need some COM Error checking. I need to learn this anyways so anyone that is willing to help me learn about COM Error checking please let me know.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Ya, great job, but I can't get these to work, mind posting examples for them?

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

Yea here are the "test" files I have created so far.

testDrives.au3

testGroups.au3

testUsers.au3

testStartup.au3

testDrives.au3

Dim $Drives

_ComputerGetDrives($Drives) ;Defaults to "FIXED"
If @error Then
    $error = @error
    $extended = @extended
    Switch $extended
        Case 1
            _ErrorMsg("DriveGetDrive Error!")
        Case 2
            _ErrorMsg("DriveGetFileSystem Error!")
        Case 3
            _ErrorMsg("DriveGetLabel Error!")
        Case 4
            _ErrorMsg("DriveGetSerial Error!")
        Case 5
            _ErrorMsg("DriveSpaceFree Error!")
        Case 6
            _ErrorMsg("DriveSpaceTotal Error!")
    EndSwitch
EndIf

For $i = 1 To $Drives[0][0] Step 1
    MsgBox(0, "Drive: " & $Drives[$i][0], "FileSystem: " & $Drives[$i][1] & @CRLF & "Label: " & $Drives[$i][2] & @CRLF & "Serial #: " & $Drives[$i][3] & @CRLF & "Free Space: " & Round($Drives[$i][4] / 1024, 2) & "GB" & @CRLF & "Total Space: " & Round($Drives[$i][5] / 1024, 2) & "GB")
Next

Func _ErrorMsg($message, $time = 0)
    MsgBox(48 + 262144, "Error!", $message, $time)
EndFunc

;===============================================================================
; Description:      Returns the drive information based on $sDriveType in a two
;                   dimensional array. First dimension is the index for each set
;                   of drive information.
; Parameter(s):     $aDriveInfo - By Reference - Drive information in an array.
;                   $sDriveType -   Type of drive to return the information on.
;                                   Options: "ALL", "CDROM", "REMOVABLE", "FIXED",
;                                   "NETWORK", "RAMDISK", or "UNKNOWN"
;                                   Defaults to "FIXED" drives.
; Requirement(s):   None
; Return Value(s):  On Success - Returns array of drive information.
;                       $aDriveInfo[0][0] = Number of Drives
;                       The second dimension is as follows: ($i starts at 1)
;                           [$i][0] - Drive Letter (ex. C:\)
;                           [$i][1] - File System
;                           [$i][2] - Label
;                           [$i][3] - Serial Number
;                           [$i][4] - Free Space
;                           [$i][5] - Total Space
;                   On Failure - Return 0 - @error - 1
;                               @extended:   1 = DriveGetDrive      Error
;                                            2 = DriveGetFileSystem Error
;                                            3 = DriveGetLabel      Error
;                                            4 = DriveGetSerial     Error
;                                            5 = DriveSpaceFree     Error
;                                            6 = DriveSpaceTotal    Error
; Author(s):        Jarvis Stubblefield (support "at" vortexrevolutions "dot" com)
; Note(s):
;===============================================================================
Func _ComputerGetDrives(ByRef $aDriveInfo, $sDriveType = "FIXED")
    Local $drive
    $drive = DriveGetDrive($sDriveType)
    If NOT @error Then
        Dim $aDriveInfo[UBound($drive)][6]
        $aDriveInfo[0][0] = $drive[0]
        For $i = 1 To $aDriveInfo[0][0] Step 1
            $aDriveInfo[$i][0] = StringUpper($drive[$i] & "\")
            $aDriveInfo[$i][1] = DriveGetFileSystem($drive[$i])
            If @error Then SetError(1, 2, 0)
            $aDriveInfo[$i][2] = DriveGetLabel($drive[$i])
            If @error Then SetError(1, 3, 0)
            $aDriveInfo[$i][3] = DriveGetSerial($drive[$i])
            If @error Then SetError(1, 4, 0)
            $aDriveInfo[$i][4] = DriveSpaceFree($drive[$i])
            If @error Then SetError(1, 5, 0)
            $aDriveInfo[$i][5] = DriveSpaceTotal($drive[$i])
            If @error Then SetError(1, 6, 0)
        Next
    Else
        SetError(1, 1, 0)
    EndIf
EndFunc ;_ComputerGetDrives

Please let me know if you have any trouble with the above examples.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Ya, great job, but I can't get these to work, mind posting examples for them?

Were you able to get them to work? I will try posting examples with each new UDF that I create.

Once I get all the UDF's completed I plan to complete my compInfo.au3 program, and I will be using two methods of storage. SQLite, and my little TXT File. That way you can choose the output. Any other output methods you think would be useful?

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Added _ComputerGetServices

Example of _ComputerGetServices

Dim $Services

_ComputerGetServices($Services)
If @error Then
    $error = @error
    $extended = @extended
    Switch $extended
        Case 1
            _ErrorMsg("Array contains no information.")
        Case 2
            _ErrorMsg("$colItems isnt an object.")
    EndSwitch
EndIf

For $i = 1 To $Services[0][0] Step 1
    MsgBox(0, "Test _ComputerGetServices", "Name: " & $Services[$i][0] & @CRLF & _
                                        "Accept Pause: " & $Services[$i][1] & @CRLF & _
                                        "Accept Stop: " & $Services[$i][2] & @CRLF & _
                                        "Check Point: " & $Services[$i][3] & @CRLF & _
                                        "Description: " & $Services[$i][4] & @CRLF & _
                                        "Creation Classname: " & $Services[$i][5] & @CRLF & _
                                        "Desktop Interact: " & $Services[$i][6] & @CRLF & _
                                        "Display Name: " & $Services[$i][7] & @CRLF & _
                                        "Error Control: " & $Services[$i][8] & @CRLF & _
                                        "Exit Code: " & $Services[$i][9] & @CRLF & _
                                        "Path Name: " & $Services[$i][10] & @CRLF & _
                                        "Process ID: " & $Services[$i][11] & @CRLF & _
                                        "Service Specific Exit Code: " & $Services[$i][12] & @CRLF & _
                                        "Service Type: " & $Services[$i][13] & @CRLF & _
                                        "Started: " & $Services[$i][14] & @CRLF & _
                                        "Start Mode: " & $Services[$i][15] & @CRLF & _
                                        "Start Name: " & $Services[$i][16] & @CRLF & _
                                        "State: " & $Services[$i][17] & @CRLF & _
                                        "Status: " & $Services[$i][18] & @CRLF & _
                                        "System Creation Classname: " & $Services[$i][19] & @CRLF & _
                                        "System Name: " & $Services[$i][20] & @CRLF & _
                                        "Tag ID: " & $Services[$i][21] & @CRLF & _
                                        "Wait Hint: " & $Services[$i][22])
Next

Func _ErrorMsg($message, $time = 0)
    MsgBox(48 + 262144, "Error!", $message, $time)
EndFunc

;===============================================================================
; Description:      Returns the services information in an array.
; Parameter(s):     $aServicesInfo - By Reference - Services Information array.
;                   $sState - OPTIONAL - Accepted values 'All' or 'Stopped' or
;                                       'Running'
; Requirement(s):   None
; Return Value(s):  On Success - Returns array of Services Information.
;                       $aServicesInfo[$i][0]  = Name
;                       $aServicesInfo[$i][1]  = Accept Pause
;                       $aServicesInfo[$i][2]  = Accept Stop
;                       $aServicesInfo[$i][3]  = Check Point
;                       $aServicesInfo[$i][4]  = Description
;                       $aServicesInfo[$i][5]  = Creation Class Name
;                       $aServicesInfo[$i][6]  = Desktop Interact
;                       $aServicesInfo[$i][7]  = Display Name
;                       $aServicesInfo[$i][8]  = Error Control
;                       $aServicesInfo[$i][9]  = Exit Code
;                       $aServicesInfo[$i][10] = Path Name
;                       $aServicesInfo[$i][11] = Process ID
;                       $aServicesInfo[$i][12] = Service Specific Exit Code
;                       $aServicesInfo[$i][13] = Service Type
;                       $aServicesInfo[$i][14] = Started
;                       $aServicesInfo[$i][15] = Start Mode
;                       $aServicesInfo[$i][16] = Start Name
;                       $aServicesInfo[$i][17] = State
;                       $aServicesInfo[$i][18] = Status
;                       $aServicesInfo[$i][19] = System Creation Class Name
;                       $aServicesInfo[$i][20] = System Name
;                       $aServicesInfo[$i][21] = Tag ID
;                       $aServicesInfo[$i][22] = Wait Hint
;                       
;                   On Failure - @error = 1 and Returns 0
;                               @extended = 1 - Array contains no information
;                                           2 - $colItems isnt an object
; Author(s):        Jarvis Stubblefield (support "at" vortexrevolutions "dot" com)
; Note(s):
;===============================================================================

Func _ComputerGetServices(ByRef $aServicesInfo, $sState = "All")
    Local $cI_Compname = @ComputerName, $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20
    Local $colItems, $objWMIService, $objItem
    Dim $aServicesInfo[1][23], $i = 1
    
    $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Service", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    
    If IsObj($colItems) Then
        For $objItem In $colItems
            If $sState <> "All" Then
                If $sState = "Stopped" AND $objItem.State <> "Stopped" Then ContinueLoop
                If $sState = "Running" AND $objItem.State <> "Running" Then ContinueLoop
            EndIf
            ReDim $aServicesInfo[UBound($aServicesInfo) + 1][23]
            $aServicesInfo[$i][0]  = $objItem.Name
            $aServicesInfo[$i][1]  = $objItem.AcceptPause
            $aServicesInfo[$i][2]  = $objItem.AcceptStop
            $aServicesInfo[$i][3]  = $objItem.CheckPoint
            $aServicesInfo[$i][4]  = $objItem.Description
            $aServicesInfo[$i][5]  = $objItem.CreationClassName
            $aServicesInfo[$i][6]  = $objItem.DesktopInteract
            $aServicesInfo[$i][7]  = $objItem.DisplayName
            $aServicesInfo[$i][8]  = $objItem.ErrorControl
            $aServicesInfo[$i][9]  = $objItem.ExitCode
            $aServicesInfo[$i][10] = $objItem.PathName
            $aServicesInfo[$i][11] = $objItem.ProcessId
            $aServicesInfo[$i][12] = $objItem.ServiceSpecificExitCode
            $aServicesInfo[$i][13] = $objItem.ServiceType
            $aServicesInfo[$i][14] = $objItem.Started
            $aServicesInfo[$i][15] = $objItem.StartMode
            $aServicesInfo[$i][16] = $objItem.StartName
            $aServicesInfo[$i][17] = $objItem.State
            $aServicesInfo[$i][18] = $objItem.Status
            $aServicesInfo[$i][19] = $objItem.SystemCreationClassName
            $aServicesInfo[$i][20] = $objItem.SystemName
            $aServicesInfo[$i][21] = $objItem.TagId
            $aServicesInfo[$i][22] = $objItem.WaitHint
            $i += 1
        Next
        $aServicesInfo[0][0] = UBound($aServicesInfo) - 1
        If $aServicesInfo[0][0] < 1 Then
            SetError(1, 1, 0)
        EndIf
    Else
        SetError(1, 2, 0)
    EndIf
EndFunc ;_ComputerGetServices

I hope everyone likes it. I am working on COM error checking at the moment for all of the COM Functions (All but _ComputerGetSoftware).

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Added _ComputerGetBIOS

Example of _ComputerGetBIOS

Dim $BIOS

_ComputerGetBIOS($BIOS)
If @error Then
    $error = @error
    $extended = @extended
    Switch $extended
        Case 1
            _ErrorMsg("Array contains no information.")
        Case 2
            _ErrorMsg("$colItems isnt an object.")
    EndSwitch
EndIf

For $i = 1 To $BIOS[0][0] Step 1
    MsgBox(0, "Test _ComputerGetBIOS", "Name: " & $BIOS[$i][0] & @CRLF & _
                                    "Status: " & $BIOS[$i][1] & @CRLF & _
                                    "BIOS Characteristics: " & $BIOS[$i][2] & @CRLF & _
                                    "BIOS Version: " & $BIOS[$i][3] & @CRLF & _
                                    "Description: " & $BIOS[$i][4] & @CRLF & _
                                    "Build Number: " & $BIOS[$i][5] & @CRLF & _
                                    "Code Set: " & $BIOS[$i][6] & @CRLF & _
                                    "Current Language: " & $BIOS[$i][7] & @CRLF & _
                                    "Identification Code: " & $BIOS[$i][8] & @CRLF & _
                                    "Installable Languages: " & $BIOS[$i][9] & @CRLF & _
                                    "Language Edition: " & $BIOS[$i][10] & @CRLF & _
                                    "List of Languages: " & $BIOS[$i][11] & @CRLF & _
                                    "Manufacturer: " & $BIOS[$i][12] & @CRLF & _
                                    "Other Target OS: " & $BIOS[$i][13] & @CRLF & _
                                    "Primary BIOS: " & $BIOS[$i][14] & @CRLF & _
                                    "Release Date: " & $BIOS[$i][15] & @CRLF & _
                                    "Serial Number: " & $BIOS[$i][16] & @CRLF & _
                                    "SM BIOS BIOS Version: " & $BIOS[$i][17] & @CRLF & _
                                    "SM BIOS Major Version: " & $BIOS[$i][18] & @CRLF & _
                                    "SM BIOS Minor Version: " & $BIOS[$i][19] & @CRLF & _
                                    "SM BIOS Present: " & $BIOS[$i][20] & @CRLF & _
                                    "Software Element ID: " & $BIOS[$i][21] & @CRLF & _
                                    "Software Element State: " & $BIOS[$i][22] & @CRLF & _
                                    "Target Operating System: " & $BIOS[$i][23] & @CRLF & _
                                    "Version: " & $BIOS[$i][24])
Next

Func _ErrorMsg($message, $time = 0)
    MsgBox(48 + 262144, "Error!", $message, $time)
EndFunc

;===============================================================================
; Description:      Returns the BIOS information in an array.
; Parameter(s):     $aBIOSInfo - By Reference - BIOS Information array.
; Requirement(s):   None
; Return Value(s):  On Success - Returns array of BIOS Information.
;                       $aBIOSInfo[$i][0]  = Name
;                       $aBIOSInfo[$i][1]  = Status
;                       $aBIOSInfo[$i][2]  = BIOS Characteristics
;                       $aBIOSInfo[$i][3]  = BIOS Version
;                       $aBIOSInfo[$i][4]  = Description
;                       $aBIOSInfo[$i][5]  = Build Number
;                       $aBIOSInfo[$i][6]  = Code Set
;                       $aBIOSInfo[$i][7]  = Current Language
;                       $aBIOSInfo[$i][8]  = Identification Code
;                       $aBIOSInfo[$i][9]  = Installable Languages
;                       $aBIOSInfo[$i][10] = Language Edition
;                       $aBIOSInfo[$i][11] = List Of Languages
;                       $aBIOSInfo[$i][12] = Manufacturer
;                       $aBIOSInfo[$i][13] = Other Target OS
;                       $aBIOSInfo[$i][14] = Primary BIOS
;                       $aBIOSInfo[$i][15] = Release Date
;                       $aBIOSInfo[$i][16] = Serial Number
;                       $aBIOSInfo[$i][17] = SM BIOS BIOS Version
;                       $aBIOSInfo[$i][18] = SM BIOS Major Version
;                       $aBIOSInfo[$i][19] = SM BIOS Minor Version
;                       $aBIOSInfo[$i][20] = SM BIOS Present
;                       $aBIOSInfo[$i][21] = Software Element ID
;                       $aBIOSInfo[$i][22] = Software Element State
;                       $aBIOSInfo[$i][23] = Target Operating System
;                       $aBIOSInfo[$i][24] = Version
;                   On Failure - @error = 1 and Returns 0
;                               @extended = 1 - Array contains no information
;                                           2 - $colItems isnt an object
; Author(s):        Jarvis Stubblefield (support "at" vortexrevolutions "dot" com)
; Note(s):
;===============================================================================
Func _ComputerGetBIOS(ByRef $aBIOSInfo)
    Local $cI_Compname = @ComputerName, $wbemFlagReturnImmediately = 0x10, $wbemFlagForwardOnly = 0x20
    Local $colItems, $objWMIService, $objItem
    Dim $aBIOSInfo[1][25], $i = 1
    
    $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    
    If IsObj($colItems) Then
        For $objItem In $colItems
            ReDim $aBIOSInfo[UBound($aBIOSInfo) + 1][25]
            $aBIOSInfo[$i][0]  = $objItem.Name
            $aBIOSInfo[$i][1]  = $objItem.Status
            $aBIOSInfo[$i][2]  = $objItem.BiosCharacteristics(0)
            $aBIOSInfo[$i][3]  = $objItem.BIOSVersion(0)
            $aBIOSInfo[$i][4]  = $objItem.Description
            $aBIOSInfo[$i][5]  = $objItem.BuildNumber
            $aBIOSInfo[$i][6]  = $objItem.CodeSet
            $aBIOSInfo[$i][7]  = $objItem.CurrentLanguage
            $aBIOSInfo[$i][8]  = $objItem.IdentificationCode
            $aBIOSInfo[$i][9]  = $objItem.InstallableLanguages
            $aBIOSInfo[$i][10] = $objItem.LanguageEdition
            $aBIOSInfo[$i][11] = $objItem.ListOfLanguages(0)
            $aBIOSInfo[$i][12] = $objItem.Manufacturer
            $aBIOSInfo[$i][13] = $objItem.OtherTargetOS
            $aBIOSInfo[$i][14] = $objItem.PrimaryBIOS
            $aBIOSInfo[$i][15] = StringMid($objItem.ReleaseDate, 5, 2) & "/" & StringMid($objItem.ReleaseDate, 7, 2) & "/" & _
                                    StringLeft($objItem.ReleaseDate, 4) & " " & StringMid($objItem.ReleaseDate, 9, 2) & ":" & _
                                    StringMid($objItem.ReleaseDate, 11, 2) & ":" & StringMid($objItem.ReleaseDate,13, 2)
            $aBIOSInfo[$i][16] = $objItem.SerialNumber
            $aBIOSInfo[$i][17] = $objItem.SMBIOSBIOSVersion
            $aBIOSInfo[$i][18] = $objItem.SMBIOSMajorVersion
            $aBIOSInfo[$i][19] = $objItem.SMBIOSMinorVersion
            $aBIOSInfo[$i][20] = $objItem.SMBIOSPresent
            $aBIOSInfo[$i][21] = $objItem.SoftwareElementID
            $aBIOSInfo[$i][22] = $objItem.SoftwareElementState
            $aBIOSInfo[$i][23] = $objItem.TargetOperatingSystem
            $aBIOSInfo[$i][24] = $objItem.Version
            $i += 1
        Next
        $aBIOSInfo[0][0] = UBound($aBIOSInfo) - 1
        If $aBIOSInfo[0][0] < 1 Then
            SetError(1, 1, 0)
        EndIf
    Else
        SetError(1, 2, 0)
    EndIf
EndFunc ;_ComputerGetBIOS

Let me know if you have any troubles or errors. I know there shouldnt be more than one BIOS information, but I wanted to leave the extra column in there just in case of some unforseen items.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Sorry, havn't been here for awhile, i'll test them tommorow if i can.

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

Sorry, havn't been here for awhile, i'll test them tommorow if i can.

Thats cool. I appreciate your dedication to helping me test them out.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Wow, all the examples work great. i'll get to work implementing them in asap. :whistle: Thank you for the UDF's!

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Link to comment
Share on other sites

  • Moderators

This is some really great stuff JS :whistle: !

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Few more coming down the pike soon. Hope to get them done in short order so I can go back finish documentation create ample examples and submit them to the UDF Standard Library.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...