am632 Posted December 8, 2010 Share Posted December 8, 2010 Hi, Is there a piece of script that will get the make and model of a computer? I want to use this to automatically name a folder with this info (i can do that bit myself tho) thanks every1 postCucumber 1 Link to comment Share on other sites More sharing options...
JohnOne Posted December 8, 2010 Share Posted December 8, 2010 I'm not sure you can, unless that info is held in these new fangles computers bois info.Maybe can help you AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
am632 Posted December 8, 2010 Author Share Posted December 8, 2010 Tnx for the reply, im sure i can use something from this. thanks Link to comment Share on other sites More sharing options...
water Posted December 8, 2010 Share Posted December 8, 2010 (edited) The Scriptomatic WMI tool is always quite helpful. The following code was generated by this tool: ; Generated by AutoIt Scriptomatic $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystemProduct", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output = $Output & "Caption: " & $objItem.Caption & @CRLF $Output = $Output & "Description: " & $objItem.Description & @CRLF $Output = $Output & "IdentifyingNumber: " & $objItem.IdentifyingNumber & @CRLF $Output = $Output & "Name: " & $objItem.Name & @CRLF $Output = $Output & "SKUNumber: " & $objItem.SKUNumber & @CRLF $Output = $Output & "UUID: " & $objItem.UUID & @CRLF $Output = $Output & "Vendor: " & $objItem.Vendor & @CRLF $Output = $Output & "Version: " & $objItem.Version & @CRLF if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop $Output="" Next Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_ComputerSystemProduct" ) Endifor this one: expandcollapse popup; Generated by AutoIt Scriptomatic $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output = $Output & "AdminPasswordStatus: " & $objItem.AdminPasswordStatus & @CRLF $Output = $Output & "AutomaticResetBootOption: " & $objItem.AutomaticResetBootOption & @CRLF $Output = $Output & "AutomaticResetCapability: " & $objItem.AutomaticResetCapability & @CRLF $Output = $Output & "BootOptionOnLimit: " & $objItem.BootOptionOnLimit & @CRLF $Output = $Output & "BootOptionOnWatchDog: " & $objItem.BootOptionOnWatchDog & @CRLF $Output = $Output & "BootROMSupported: " & $objItem.BootROMSupported & @CRLF $Output = $Output & "BootupState: " & $objItem.BootupState & @CRLF $Output = $Output & "Caption: " & $objItem.Caption & @CRLF $Output = $Output & "ChassisBootupState: " & $objItem.ChassisBootupState & @CRLF $Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF $Output = $Output & "CurrentTimeZone: " & $objItem.CurrentTimeZone & @CRLF $Output = $Output & "DaylightInEffect: " & $objItem.DaylightInEffect & @CRLF $Output = $Output & "Description: " & $objItem.Description & @CRLF $Output = $Output & "Domain: " & $objItem.Domain & @CRLF $Output = $Output & "DomainRole: " & $objItem.DomainRole & @CRLF $Output = $Output & "EnableDaylightSavingsTime: " & $objItem.EnableDaylightSavingsTime & @CRLF $Output = $Output & "FrontPanelResetStatus: " & $objItem.FrontPanelResetStatus & @CRLF $Output = $Output & "InfraredSupported: " & $objItem.InfraredSupported & @CRLF $strInitialLoadInfo = $objItem.InitialLoadInfo(0) $Output = $Output & "InitialLoadInfo: " & $strInitialLoadInfo & @CRLF $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF $Output = $Output & "KeyboardPasswordStatus: " & $objItem.KeyboardPasswordStatus & @CRLF $Output = $Output & "LastLoadInfo: " & $objItem.LastLoadInfo & @CRLF $Output = $Output & "Manufacturer: " & $objItem.Manufacturer & @CRLF $Output = $Output & "Model: " & $objItem.Model & @CRLF $Output = $Output & "Name: " & $objItem.Name & @CRLF $Output = $Output & "NameFormat: " & $objItem.NameFormat & @CRLF $Output = $Output & "NetworkServerModeEnabled: " & $objItem.NetworkServerModeEnabled & @CRLF $Output = $Output & "NumberOfLogicalProcessors: " & $objItem.NumberOfLogicalProcessors & @CRLF $Output = $Output & "NumberOfProcessors: " & $objItem.NumberOfProcessors & @CRLF $strOEMLogoBitmap = $objItem.OEMLogoBitmap(0) $Output = $Output & "OEMLogoBitmap: " & $strOEMLogoBitmap & @CRLF $strOEMStringArray = $objItem.OEMStringArray(0) $Output = $Output & "OEMStringArray: " & $strOEMStringArray & @CRLF $Output = $Output & "PartOfDomain: " & $objItem.PartOfDomain & @CRLF $Output = $Output & "PauseAfterReset: " & $objItem.PauseAfterReset & @CRLF $strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0) $Output = $Output & "PowerManagementCapabilities: " & $strPowerManagementCapabilities & @CRLF $Output = $Output & "PowerManagementSupported: " & $objItem.PowerManagementSupported & @CRLF $Output = $Output & "PowerOnPasswordStatus: " & $objItem.PowerOnPasswordStatus & @CRLF $Output = $Output & "PowerState: " & $objItem.PowerState & @CRLF $Output = $Output & "PowerSupplyState: " & $objItem.PowerSupplyState & @CRLF $Output = $Output & "PrimaryOwnerContact: " & $objItem.PrimaryOwnerContact & @CRLF $Output = $Output & "PrimaryOwnerName: " & $objItem.PrimaryOwnerName & @CRLF $Output = $Output & "ResetCapability: " & $objItem.ResetCapability & @CRLF $Output = $Output & "ResetCount: " & $objItem.ResetCount & @CRLF $Output = $Output & "ResetLimit: " & $objItem.ResetLimit & @CRLF $strRoles = $objItem.Roles(0) $Output = $Output & "Roles: " & $strRoles & @CRLF $Output = $Output & "Status: " & $objItem.Status & @CRLF $strSupportContactDescription = $objItem.SupportContactDescription(0) $Output = $Output & "SupportContactDescription: " & $strSupportContactDescription & @CRLF $Output = $Output & "SystemStartupDelay: " & $objItem.SystemStartupDelay & @CRLF $strSystemStartupOptions = $objItem.SystemStartupOptions(0) $Output = $Output & "SystemStartupOptions: " & $strSystemStartupOptions & @CRLF $Output = $Output & "SystemStartupSetting: " & $objItem.SystemStartupSetting & @CRLF $Output = $Output & "SystemType: " & $objItem.SystemType & @CRLF $Output = $Output & "ThermalState: " & $objItem.ThermalState & @CRLF $Output = $Output & "TotalPhysicalMemory: " & $objItem.TotalPhysicalMemory & @CRLF $Output = $Output & "UserName: " & $objItem.UserName & @CRLF $Output = $Output & "WakeUpType: " & $objItem.WakeUpType & @CRLF $Output = $Output & "Workgroup: " & $objItem.Workgroup & @CRLF if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop $Output="" Next Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_ComputerSystem" ) Endif Func WMIDateStringToDate($dtmDate) Return (StringMid($dtmDate, 5, 2) & "/" & _ StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _ & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2)) EndFunc Edited December 8, 2010 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
postCucumber Posted August 21, 2018 Share Posted August 21, 2018 This information is stored in the registry and can be retrieved using the RegRead() function. Here's a quick way to read this info from the registry and display it in message boxes. #RequireAdmin #include <MsgBoxConstants.au3> Local $manufacturer = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS", "SystemManufacturer") Local $model = RegRead("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\BIOS", "SystemProductName") MsgBox($MB_SYSTEMMODAL, "", "Manufacturer: " & $manufacturer) MsgBox($MB_SYSTEMMODAL, "", "Model: " & $model) whydude 1 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 22, 2018 Moderators Share Posted August 22, 2018 @postCucumber did you not notice that this thread is 8 years old?! Please don't resurrect old threads. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
postCucumber Posted August 22, 2018 Share Posted August 22, 2018 I did notice, but I also noticed that there was no concise answer and figured that someone could benefit from the answer that I gave. I see no issue in doing this. Sorry if I broke any rules. Link to comment Share on other sites More sharing options...
whydude Posted December 19, 2019 Share Posted December 19, 2019 On 8/22/2018 at 11:30 PM, postCucumber said: I did notice, but I also noticed that there was no concise answer and figured that someone could benefit from the answer that I gave. I see no issue in doing this. Sorry if I broke any rules. @postCucumber Your information was perfect for what I needed. Regardless of this threads age I'm glad you posted to give a concise answer. Thanks a bunch!! 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