reg: The One-Size-Fits-All Registry Tool

I have been heard to describe the reg.exe utility as "RegEdt32 in a can.” It does almost everything RegEdt32 can do, but it allows you to do it from a command line. Not only is this a boon when you want to quickly make a change without firing up RegEdt32 ; it also allows you to embed Registry operations in logon scripts and batch files. (Of course, you learned how to use the Registry from within Perl in Chapter 8, but for the non-Perl-hackers among us, reg is a welcome substitute.)

If you’ve ever used the net command, you’ll immediately recognize how reg works. Like net, you use reg by giving it a command from a short list of options (query, add, delete, copy, save, load, unload, restore, compare, export, and import), followed by one or more optional parameters that the command you specify interprets. Here’s a short example in which reg gets the query command for a specified subkey of HKLM:

C:\reskit>reg query HKLM\Software\Qualcomm /s

Listing of [Software\Qualcomm]

[Eudora]
[Eudora\3.0.1]

Here’s the problem with reg: the Windows 2000 and NT versions have different command-line parameters and switches. In an effort to do away with the clutter of multiple tools, Microsoft revamped the interface for the Windows 2000 reg tool, making it more functional and more consistent, not to mention unlike its older brother.

Using the Windows 2000 Version of reg

The Windows 2000 version of reg.exe offers 11 separate functions, ranging from querying for the ...

Get Managing The Windows 2000 Registry now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.