Sign in to follow this  
Followers 0
soulcaliburvn

Can AutoIT get hardware infomation ?

13 posts in this topic

I need get hardware infomation, example : HDD serial, Graphic Card Serial, NIC serial, Sound card serial, Mainboard serial .

Can autoIT can get them ?

Thanks for help

Share this post


Link to post
Share on other sites



Yes it can but you should ask these questions in the SUPPORT FORUM !!

#Include <Constants.au3>

Dim $strComputer, $objWMIService
Const $wbemFlagReturnImmediately = 0x10
Const $wbemFlagForwardOnly = 0x20

$strComputer = inputbox( "Please enter the name of the computer you want", "Input","localhost")
$objWMIService = ObjGet("winmgmts:{(RemoteShutdown)}//" & $strComputer & "\root\CIMV2")

_Read_BioS()
_Read_CPU()
_Read_OS()
_Read_OS_Inst()
_Read_DriveInfo()

Func _Read_BioS()
Local $colItems = ""
  $colItems = $objWMIService.ExecQuery("Select * from Win32_BIOS")
   
   For $objItem in $colItems
     Local $item = $objItem.SerialNumber
        MsgBox(0,'Output','Bios Serial #: ' & $Item)    
   Next
EndFunc

Func _Read_CPU()
Local $colItems = ""
  $colItems = $objWMIService.ExecQuery("Select * from Win32_Processor")
   
   For $objItem in $colItems
     Local $item = $objItem.Name
        MsgBox(0,'Output','CPU Type: ' & $Item) 
   Next
EndFunc

Func _Read_OS()
Local $colItems = ""
  $colItems = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
   
   For $objItem in $colItems
     Local $item = $objItem.SerialNumber
        MsgBox(0,'Output','OS Serial #: ' & $Item)  
   Next
EndFunc

Func _Read_OS_Inst()
Local $colItems = ""
  $colItems = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
   
   For $objItem in $colItems
     Local $date = $objItem.InstallDate
            
    $CDate = (StringMid($Date, 5, 2) & "/" & _
        StringMid($Date, 7, 2) & "/" & StringLeft($Date, 4) _
            & " " & StringMid ($Date, 9, 2) & ":" & _
                StringMid($Date, 11, 2) & ":" & StringMid($Date, _
                    13, 2))
    MsgBox(0,'Output','Install Date/Time #: ' & $CDate)
    Next
EndFunc

Func _Read_DriveInfo()
    Local $colItems = ""
    $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_DiskDrive", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    For $objItem in $colItems
     Local $item = $objItem.Model
        MsgBox(0,'Output','Drive Model : ' & $Item)
        Local $item = $objItem.Signature
        MsgBox(0,'Output','Drive Signature : ' & $Item)
     Next
EndFunc

Enjoy !!

Share this post


Link to post
Share on other sites

Yes and please see my signature for a set of UDF's that should get you most of the information you are wanting. I will be working on more hardware features soon.

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)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thank you so much..........

I'll try....

but how to get info of sound card, video card

Edited by soulcaliburvn

Share this post


Link to post
Share on other sites

Um, Your sound card and video card have serial numbers? What do you need these for? Wouldn't the MAC (an unique value) be more appropriate for your network card?

Share this post


Link to post
Share on other sites

Could be for inventory, at an old intership I had we had to write down the serial #'s for every part that wasnt original to a computer. I tired to pull the serial off 100 cdrw's we installed (with wmi), but though the property was there they never filled it in.

(Long day writing down alphanumeric strings.


Share this post


Link to post
Share on other sites

Puff... First v3 Script and Scraps is been full of questions, and now Developers. I think somewhere needs to be a sticky with title "READ ME FIRST" and description "Do not post questions here, post them in Support!".

Can someone make it?

i542


I can do signature me.

Share this post


Link to post
Share on other sites

Could be for inventory, at an old intership I had we had to write down the serial #'s for every part that wasnt original to a computer. I tired to pull the serial off 100 cdrw's we installed (with wmi), but though the property was there they never filled it in.

(Long day writing down alphanumeric strings.

You can run down to the corner store and buy some striped paint to mark the units with their serial numbers. It goes well with the large packet of mounting holes for the drives.

You aren't pulling our collective legs, are you? :whistle:

Share this post


Link to post
Share on other sites

You can run down to the corner store and buy some striped paint to mark the units with their serial numbers. It goes well with the large packet of mounting holes for the drives.

You aren't pulling our collective legs, are you? :whistle:

Huh? No, I am not pulling your leg. I worked for the county government as an IT intern a few summers ago and we were required to have the serial number for every part that wasn't original to the computer. That means when we got a shipment in from HP all we needed was the computer seial number, but when we replaced or added new hardware we had to write down the serial for the hardware indentory db. It normally wasnt an issue since these kind of replacements were rare, but once we had to upgrade ~100 computers to have cdrw's (instead of their current cdrs) and one guy put them all in forgetting to write down the serials. Naturally the intern (me) was tasked to correct his mistake. I tried to do it wia the intranet and wmi but no luck. Was an extra pain since they had been spread across ~10 different geographic locations.


Share this post


Link to post
Share on other sites

I feel for you. Are you sure they didn't give you this useless task as an exercise to keep you out of mischief and waste your time so they didn't have to closely supervise you? :whistle:

Most equipment that has machine readable serial numbers is because somebody asked for it. If it is not offered, then I would be querying the need to obtain it in the first place. In your situation, unless you were attempting to track stolen CDRW drives, why would you bother? Just store the fact that it either has a CDRW drive installed or doesn't, not what the serial number is. If you needed to, track the model number, which is usually electronically available amongst your PNP attributes via WMI calls, as needed for driver support in a SOE type environment.

Share this post


Link to post
Share on other sites

I think you missed somthing, I said I worked for the GOVERNMENT. This was their SOP, and to be fair I have seen this doen at other places as well. The hardware database was used for life cycle replacement planning and warrentee checking. If XXXXX sent them an email saying "my drives broke" they could look up the serial check the warentee and model and see what the next step was. It might not have been the best way in the world but it worked pretty well. The need for serial numbers is one that almost every organization has.


Share this post


Link to post
Share on other sites

Can anyone tell me how to get motherboard name and model in msg box?
For example:
Name: Asus
Model: P5PL2

Share this post


Link to post
Share on other sites

Don't necro a thread that is 7 years old!

Search for "Scriptomatic" or "Computer info" on the forum. You'll find a lot of information.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2016-12-04 - Version 1.2.2.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

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