AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Report Physical RAM installed

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
david.kingham



Joined: 06 Nov 2007
Posts: 24

PostPosted: Tue Oct 14, 2008 10:52 pm    Post subject: Report Physical RAM installed Reply with quote

I need my script to simply read how much physical ram is installed, this is what I've come up with so far is this

Code:
Run msinfo32.exe /categories +SWEnvStartupPrograms /report C:\test.txt
FileReadLine RAM, C:\test.txt, 25
StringTrimLeft RAM, RAM, 22
StringTrimRight RAM, RAM, 7
MsgBox %RAM%


Simple enough, but it seems as though the txt file that msinfo creates is encrypted or something, if I read the first line I just get weird characters. If I create a new txt file and paste in the same text from the original file it will read the new file just fine.

Is there any easier way to go about this?
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Oct 14, 2008 11:09 pm    Post subject: Reply with quote

http://www.autohotkey.com/forum/viewtopic.php?t=8042
Back to top
david.kingham



Joined: 06 Nov 2007
Posts: 24

PostPosted: Tue Oct 14, 2008 11:17 pm    Post subject: Reply with quote

That doesn't seem to report the RAM correctly, says I have 4TB...I don't think so, only 12GB
Back to top
View user's profile Send private message
david.kingham



Joined: 06 Nov 2007
Posts: 24

PostPosted: Thu Oct 16, 2008 2:56 pm    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
daonlyfreez



Joined: 16 Mar 2005
Posts: 949
Location: Berlin

PostPosted: Thu Oct 16, 2008 5:00 pm    Post subject: Reply with quote

Function similar to AutoIt's MemGetStats

HTH
_________________
mirror 1mirror 2mirror 3ahk4.me • PM or
Back to top
View user's profile Send private message
david.kingham



Joined: 06 Nov 2007
Posts: 24

PostPosted: Thu Oct 16, 2008 5:34 pm    Post subject: Reply with quote

That has potential but it also reports the ram incorrectly, I have 12gb and it says this: Available Physical Ram: 4194304k
Possibly something to do with XP64? Or am I missing something very obvious with some sort of conversion?
Back to top
View user's profile Send private message
evan
Guest





PostPosted: Thu Oct 16, 2008 5:40 pm    Post subject: Reply with quote

i remember when my friend bought his new sony laptop (which has 4GBram)
and its only displaying 3GB ram on system
the sales person told him to update/install something in order for the computer to recognized there are 4GB ram
so it might similar in ur case
the method u use to output will not recognized something over 4GB
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Thu Oct 16, 2008 8:03 pm    Post subject: Reply with quote

Code:
; http://www.autohotkey.com/forum/viewtopic.php?p=225823#225823

VarSetCapacity( MEMORYSTATUSEX,64,0 ), NumPut( 64,MEMORYSTATUSEX )
DllCall( "GlobalMemoryStatusEx", UInt,&MEMORYSTATUSEX )
TotalPhys := NumGet( MEMORYSTATUSEX,8,"Int64"),   VarSetCapacity( PhysMem,16,0 )
DllCall( "shlwapi.dll\StrFormatByteSize64A", Int64,TotalPhys, Str,PhysMem, UInt,16 )
; StrFormatByteSize64 : http://msdn.microsoft.com/en-us/library/bb759971(VS.85).aspx
MsgBox, 64, Total Physical Memory, %TotalPhys% Bytes`n= %PhysMem%

/*

GlobalMemoryStatusEx     : http://msdn.microsoft.com/en-us/library/aa366589(VS.85).aspx
Requires Windows Vista, Windows XP, or Windows 2000 Professional.

typedef struct _MEMORYSTATUSEX { 
DWORD dwLength; 
DWORD dwMemoryLoad; 
DWORDLONG ullTotalPhys; 
DWORDLONG ullAvailPhys; 
DWORDLONG ullTotalPageFile; 
DWORDLONG ullAvailPageFile; 
DWORDLONG ullTotalVirtual; 
DWORDLONG ullAvailVirtual; 
DWORDLONG ullAvailExtendedVirtual;
} MEMORYSTATUSEX,  *LPMEMORYSTATUSEX;

*/

_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
david.kingham



Joined: 06 Nov 2007
Posts: 24

PostPosted: Fri Oct 17, 2008 3:01 pm    Post subject: Reply with quote

That works brilliantly, thank you sir.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group