Jump to content

how much RAM by code?


soporific

Recommended Posts

I was wondering ...

for the Windows 98 environment, ie before Win2K which has this feature built in, has anyone heard of or seen any sign of a way to tell how much RAM your system has, using code? I want to run a batch file that allows a variable to be set according to how much RAM is present.

I could cheat and ask for user input, but that's way inelegant and thus not sufficient for this project - only the best will do!!

Who will rise up to the challenge? Come on you legend you ...

Link to comment
Share on other sites


Use a VB script (WMI is required also):

strComputer = "."
Set wbemServices = GetObject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_LogicalMemoryConfiguration")
For Each wbemObject In wbemObjectSet
   WScript.Echo "Total physical memory (KB): " & wbemObject.TotalPhysicalMemory
Next

Link to comment
Share on other sites

excellent, thanks for that ...

I was hoping to do it at the stage when msbatch.inf executes, which is way before the windows GUI loads but its not important when it occurs ... this is for the purpose of setting the vcache in system.ini ... so, is there a way to us that VB script to update the system.ini based upon how much RAM is present after setup reaches the first boot to the desktop?

(by the way I have never used VB scripts before - can get give some links on how to learn, or give me more info, please!) B)

Edited by soporific
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...