VBScript - How much memory? Processor Info?

I need to get the RAM (total/free) and the processor info (speed/type) without using the WMI because this script will run on Win95/98 boxes that might not have WMI installed.
schworgjAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dasmcseCommented:
If it were me, I would script the installation of WMI (via login script) on those Win9x boxes since permissions aren't an issue. The vbScript could then check if WMI is present, collect the inventory. I have an old kixtart script I could post that installs WMI. I know your question was about vbScript, but you can lauch a kixtart script from within vbScript.
0
schworgjAuthor Commented:
I have been told that we are not to install anything on these computers. Scripting the install was my first thought too.
0
grayeCommented:
That's a tall order... particularly if your stuck with VBScript and can't use WMI

The CPU Identifieris at HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0.   On newer OS (but not Win9x), the CPU speed is also at that location

Memory can be obtained using the GlobalMemoryStatus API

Type MEMORYSTATUS
    dwLength As Long
    dwMemoryLoad As Long
    dwTotalPhys As Long
    dwAvailPhys As Long
    dwTotalPageFile As Long
    dwAvailPageFile As Long
    dwTotalVirtual As Long
    dwAvailVirtual As Long
End Type

Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)

    Dim mem As MEMORYSTATUS
    Dim mb As Long
 
    mem.dwLength = Len(mem)
    GlobalMemoryStatus mem
    ' add 384k to account for upper memory area
    mb = (mem.dwTotalPhys + 393216) / 1048576
   
    ' round off to nearest MB
    If ((mb * 1048576) - mem.dwTotalPhys - 393216) > 524288 Then
        mb = mb + 1
    End If
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

schworgjAuthor Commented:
Can't use this code in VBScript. At least not the memory section. Thanks for the registry location of the processor.  I'll leave the question open a bit longer to see if I can get the memory part answered too then split the points accordingly.
0
grayeCommented:
Yeah, if you're stuck with VBScript, your hands are kinda tied.   However VBScript can use DLLs.  For example, there are a lot of good CPU detection/speed tools available as COM-based DLLs.

Are you at least allowed to register a DLL on these PCs?
0
schworgjAuthor Commented:
I got the CPU info out of the registry. It isn't as much info as we would like but it will do. I am amazed that there isn't a simple way to check total/free memory without some DLL or WMI. VBScript is pretty limited in what it can do without external tools.

I don't think we are supose to put anything beyond the single script on the user's PC. Actually, the script is sitting on a network drive and just gets called. Long story but we are trying not to actually install anything beyond a shortcut to this script.

Driving me nuts.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.