Registry Console Utility


Registry Console Utility \ windows \system32\reg.exe

The Registry Console Utility performs all the functions of the Registry Editor, discussed in Chapter 5, but can be used from the command line. It also does a few things Registy Editor can't do, such as making a duplicate of a registry key or comparing two registry keys. To use the Registry Console Utility, type reg followed by one of the following commands and any applicable parameters:

Command

Description

query keyname [/v valuename /ve] [/s]

Displays the data stored in a Registry value; omit /v valuename to display list of all the values in keyname (include /s to query all subkeys), or specify /ve to query the (Default) value. Keyname can also include the name of a remote computer, like this: query computer \ keyname .

add keyname [/v valuename /ve] [/d data ] [/t typ ] [/s sep ] [/f]

Adds a new value. The keyname , valuename , /v , and /ve options are the same as with query, listed previously. The /d option assigns data to the new value; if omitted, the new value will be empty. Use /t to specify the data type for the value; the default is string (REG_SZ). Specify /f to overwrite existing values without prompting.

delete keyname [/v valuename /ve /va] [/f]

Deletes an existing value. All options are the same as with add, above. The /va parameter instructs the Registry Console Utility to delete all values in the specified key.

copy keyname1 keyname2 [/s] [/f]

Duplicates a key and all its values, where keyname1 is the full path of the source key, and keyname2 is the full path of the new key. Specify /s to include all subkeys and their values, and use the /f option to skip the prompt.

save keyname filename

Saves a portion of the registry, keyname , into a binary hive file, filename . The root key in keyname must be a four-letter abbreviation (e.g., HKLM, HKCU, HKCR, HKU, HKCC). Use export to create a registry patch ( .reg ) file. See also restore .

restore keyname filename

Imports keyname from a hive file (created with save , listed previously) into the Registry. As with save , you must use the four-letter root key abbreviation.

load keyname filename

Mounts a hive file (created with save , above) onto the Registry. Load is similar to restore , above, except changes to the keys are subsequently written back to the source hive file.

unload keyname

Unmounts a key, keyname , that has been installed with load , above.

compare keyname1 keyname2 [/v valuename /ve] [/s] [ output ]

Compares two keys or values, keyname1 and keyname2 . The /v , /ve , and /s options are the same as with add , listed earlier. Output can be /oa (output all differences and matches), /od (output only differences, the default), /os (output only matches), or /on (no output).

export keyname filename

Creates a registry patch ( .reg ), filename , from keyname . Registry patches can be imported with import , below, or by double-clicking in Explorer (via Registry Editor).

import filename

Imports a registry patch ( .reg ), filename , created either with export , listed earlier, or with the Registry Editor.



Windows XP Pocket Reference
Windows XP Pocket Reference
ISBN: 0596004257
EAN: 2147483647
Year: 2001
Pages: 154
Authors: David A. Karp

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net