Can't I do this without VBscript?
You could do it in a C/C++ program with the Reg* family of functions.
JPSoft's "4NT" and "TakeCommand" command interpreters have built-in
registry-reading functions that could be used in batch files.
There's a Microsoft utility called REG.EXE. It has been around a while and
I don't recall exactly where is (maybe some Resource Kit). It allows
reading the registry from a CMD command line. Here's the top-level help
message for REG.EXE.
Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved
REG Operation [Parameter List]
Operation [ QUERY | ADD | DELETE | COPY |
SAVE | LOAD | UNLOAD | RESTORE |
COMPARE | EXPORT | IMPORT ]
Return Code: (Except of REG COMPARE)
0 - Succussful
1 - Failed
For help on a specific operation type:
REG Operation /?
Examples:
REG QUERY /?
REG ADD /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?
Here's an example of its use:
v:\> reg query HKCU\Environment /v home
! REG.EXE VERSION 3.0
HKEY_CURRENT_USER\Environment
home REG_SZ d:\home