Sign in to follow this  
Followers 0
ashley

Get RAM and HDD sapce info.

13 posts in this topic

urm do anybody know any ready made code that i can adapt that shows the RAM and HDD info. also if possible is the RAM over 85%, the text turns red. and if the hdd sapce is over 85% used then it goes red too.

thanks.

Share this post


Link to post
Share on other sites



#6 ·  Posted (edited)

MsgBox(1,"",PercentMemoryFree() & "% Free physical memory")
MsgBox(1,"",PercentHardDriveFree() & "% Free space on C:")

Func PercentMemoryFree()
    Local $objWMI = ObjGet("winmgmts:\\.\root\cimv2")
    Local $collection = $objWMI.ExecQuery("Select * from Win32_OperatingSystem")
    Local $FreeMemory
    Local $TotalMemory
    Local $obj

    For $obj In $collection
        $FreeMemory = $obj.FreePhysicalMemory
    Next

    $collection = $objWMI.ExecQuery("Select * from Win32_ComputerSystem")
    For $obj In $collection
        $TotalMemory = $obj.TotalPhysicalMemory
    Next
    
    Return Int((($FreeMemory*1024) / $TotalMemory) * 100)
EndFunc


Func PercentHardDriveFree()
Return Int((DriveSpaceFree("C:") / DriveSpaceTotal("C:")) * 100)
EndFunc

Edited by covaks

Share this post


Link to post
Share on other sites

Sure, go ahead. :-)

Share this post


Link to post
Share on other sites

Wel, I sure didn't. lol. That would have helped.

Share this post


Link to post
Share on other sites

yes i have but on my oldpc, im currently on my new lkaptop, which don't have autoit yet... so all the program script(including all-in-one protection center) have been written in notepad lol.

ill check that scrip out thta u posted 2moz

thanks.

Share this post


Link to post
Share on other sites

yes i do. but im getting an Anti-virus before i download anything...

i trust autoit not to have any in, but when i download one thing i get obsessed and download 100's of things lol... so it best to wait... anyways im getting virus protection 2day so,so ill have in n time.

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