Jump to content

Ram And Cpu From Remote Pc


Recommended Posts

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 by spanga
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

I fyou want to start using WMI there is only 1 way

Scriptomatic V2.0

Look 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

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

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...