Skip to content

Retrieving basic PC information

How to get basic system specification info from the PC.

Q:  Briant Manix writes:  “Do you know how to get basic system specification info from the PC? I would imagine that the function would either use a Windows API or e look up in the Registry. I want to get an Access app to use VBA to interrogate the PC to determine if it meets the pre- install requirements.”

A:  Years ago (maybe in Access 2 or 95) I dimly remember doing something (probably with API calls) to put some system information on an Access form, but I can’t find this information currently (and if I could, it might not work with Access 2003 or 2007).

You can get a fair amount of system information through the Word System object without API calls (set a reference to Word in your Access code so you can use named constants for the property arguments).  However, it is not too accurate at present; apparently it has not been updated for many years.  I got “Windows NT” for the OS (on a computer running Win XP SP 2) and “Pentium” for the processor (it is actually a dual-core Intel chip).  There are no arguments for memory or available drives.  Figure C shows the attributes of the System object in the Object Browser:

Figure C.  The Word System object in the Object Browser

There is a list of API calls on the Microsoft Web site.  However, there is no explanation of the calls, and no examples of usage.

Another possibility is to use the PrivateProfileString property of the Word System object (this is a hidden property, so you won’t see it in the Object Browser unless you turn on hidden members display).  The problem with this method is that the Registry is different on different computers, depending on their OS, so you can’t depend on getting reliable information from the same Registry key on all computers.  The lines below print the Documents path to the Immediate window:

Set appWord = GetObject(, “Word.Application”)

strDocsPath = appWord.System.PrivateProfileString(“”, _

  “HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell _

  Folders”, “Personal”) & “”

Debug.Print “Docs path: ” & strDocsPath

About this author