evilertoaster Posted May 17, 2006 Share Posted May 17, 2006 (edited) Does any one know a way to get the total RAM and processor speed of a remote pc. I'm thinking a registry key or file might have this somewhere but i can't find it... Edited May 17, 2006 by evilertoaster Link to comment Share on other sites More sharing options...
spanga Posted May 18, 2006 Share Posted May 18, 2006 (edited) Does any one know a way to get the total RAM and processor speed of a remote pc. I'm thinking a registry key or file might have this somewhere but i can't find it...Try this: $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $computerName = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $computerName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $CPUSpeed = $objItem.CurrentClockSpeed Next EndIf $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Memory = $objItem.TotalPhysicalMemory Next EndIf Now you (I hope) you get $CPUSpeed and $Memory Edited May 18, 2006 by spanga Link to comment Share on other sites More sharing options...
nitro322 Posted May 18, 2006 Share Posted May 18, 2006 spanga, this is a fantastic tip. I had no idea that AutoIt could do this. Thanks! Of course, I don't really have any burning need to do something like this at the moment, but I'm sure it'll be helpful in the future. http://www.legroom.net/ Link to comment Share on other sites More sharing options...
blademonkey Posted May 18, 2006 Share Posted May 18, 2006 Try this: $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $computerName = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $computerName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $CPUSpeed = $objItem.CurrentClockSpeed Next EndIf $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Memory = $objItem.TotalPhysicalMemory Next EndIf Now you (I hope) you get $CPUSpeed and $Memory this is quite amazing. how can i find more WMI objects to call and a little in depths look (from a newbie point of view) of object calling from AUTOIT? thanks. this has totally sparked my interest. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
Uten Posted May 18, 2006 Share Posted May 18, 2006 Search for WMI at msdn.microsoft.com Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
ptrex Posted May 18, 2006 Share Posted May 18, 2006 I fyou want to start using WMI there is only 1 way Scriptomatic V2.0Look via the Search in the script and scratch forum, because there is a version for AutoIt as well.Enjoy !! Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 18, 2006 Moderators Share Posted May 18, 2006 I fyou want to start using WMI there is only 1 way Scriptomatic V2.0Look via the Search in the script and scratch forum, because there is a version for AutoIt as well.Enjoy !!Is that like scratch and sniff --- Just ribbing ya a bit, we all know you meant Scripts and Scraps Here is the link: http://www.autoitscript.com/forum/index.ph...hl=Scriptomatic 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 More sharing options...
ptrex Posted May 18, 2006 Share Posted May 18, 2006 OK I think I' ve had too much wine Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
evilertoaster Posted May 19, 2006 Author Share Posted May 19, 2006 Hey, respone is a bit late but yea thanks for showing me that spanga, i hade no idea WMi could access remtote machines...just for some clarification- 'winmgmts:\\' is what makes it connect to a remote PC right? is there an MSDN page on this? after you connect like that is there a way to show what WMI objects are aviable on a remote machine like scriptomatic does on a local one? are do you just guess^^? 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