Home > Commands N-Z > Commands R

REG


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Read, Set or Delete registry keys and values.


Syntax

REG ADD [ROOTKEY\]Key[\'ValueName']=Value [DataType] [\\Machine]

REG COMPARE [ROOTKEY\]Key [ROOTKEY\]Key [-o[M][D]] [-q] [-e] [\\Machine]

REG COPY [ROOTKEY\]Key[\'ValueName'] [\\Machine] [ROOTKEY\]Key[\'ValueName'] [\\Machine]

REG DELETE [ROOTKEY\]Key[\'ValueName'] [/FORCE] [\\Machine]

REG DUMP [ROOTKEY\]Key[\'ValueName'] FileName [\\Machine]

REG FIND [ROOTKEY\]Key [DataType] SearchStr [ReplaceStr] [-y] [-z[R]] [\\Machine]

REG LOAD FileName [ROOTKEY\]Key [\\Machine]

REG QUERY [ROOTKEY\]Key[\'ValueName'] ["String"] [/S] [/size] [/list] [\\Machine]

REG RESTORE FileName [ROOTKEY\]Key [\\Machine]

REG {SAVE | BACKUP} [ROOTKEY\]Key[\'ValueName'] FileName [\\Machine]

REG UNLOAD [ROOTKEY\]Key [\\Machine]

REG UPDATE [ROOTKEY\]Key[\'ValueName']=Value [\\Machine]

NTXP Syntax:

REG {ADD | COMPARE | COPY | DELETE | EXPORT | IMPORT | LOAD | QUERY | RESTORE | SAVE | UNLOAD} /?

REG ADD [\\Machine] [ROOTKEY\]Key [/d value] [/f] [/s separator] [/t data_type] [/v entry_name | /ve]

REG COMPARE [\\Machine] [ROOTKEY\]Key [\\Machine] [ROOTKEY\]Key {[/oa] | [/od] | [/on] | [/os]} [/s separator] [/v entry_name | /ve]

REG COPY [\\Machine] [ROOTKEY\]Key [\\Machine] [ROOTKEY\]Key [/f] [/s]

REG DELETE [\\Machine] [ROOTKEY\]Key [/f] [/v entry_name | /va | /ve]

REG EXPORT [\\Machine] [ROOTKEY\]Key FileName [/y]

REG IMPORT FileName

REG LOAD [\\Machine] [ROOTKEY\]Key FileName

REG QUERY [\\Machine] [ROOTKEY\]Key [/c] [/d | /k] [/e] [/f data] [/s] [/se separator] [/t type] [/v entry_name | /ve] [/z]

REG RESTORE [\\Machine] [ROOTKEY\]Key FileName

REG SAVE [\\Machine] [ROOTKEY\]Key FileName [/y]

REG UNLOAD [\\Machine] [ROOTKEY\]Key


Parameters
DataType (NT4)
One of:
FileName (NT4)
The filename to save to or restore from (without an extension).
NT: On remote machines the file is written to the System32 directory.
Win95: On remote machines the file is written to the Windows directory.
(NTXP)
The filename to IMPORT/EXPORT from/to, must have .REG extension.
Specifies the name and path of the file that will be LOADed/RESTOREd. This file must have been created with the REG SAVE operation using a .HIV extension.
Key (NT4)
The full name of a key under the selected ROOTKEY.
\\Machine (NT4)
Name of remote machine - omitting defaults to current machine. Only HKLM and HKU are available on remote machines.
ReplaceStr (NT4)
Value to replace.
ROOTKEY\ (NT4)
one of:
SearchStr (NT4)
Value to search for.
String (NT4)
String to search for.
Value (NT4)
?
\'ValueName' (NT4)
The value, under the selected Key, to edit (default is all keys and values). Enclose ValueNames that contain the \ character in single quotes.

Switches
/? (NTXP)
Displays help.
/c (NT2003)
Specifies that the query is case sensitive. By default, queries are not case sensitive.
/d value (NTXP)
REG ADD: Specifies the value for the new registry entry.
/d (NT2003)
REG QUERY: Specifies to search in data only.
-e (NT4)
Sets the error level to the error code that was in effect the last time the utility was run. By default, the error level is set to the number of differences that were found.
/e (NT2003)
REG QUERY: Specifies to return only exact matches. By default, all the matches are returned.
/f (NTXP)
Adds/Copies/Deletes the subkey or entry without asking for confirmation.
/f data (NT2003)
REG QUERY: Specifies the data or pattern for which to search. Use double quotes if a string contains spaces. If not specified, a wildcard ("*") is used as the search pattern.
/FORCE (NT4)
Force a deletion without asking "are you are sure".
/k (NT2003)
Specifies to search in key names only.
/list (NT4)
Search strings from RegistryPath.
-o[M][D] (NT4)
Omit screen output of:
/oa (NTXP)
Specifies that all differences and matches are displayed. By default, only the differences are listed.
/od (NTXP)
Specifies that only differences are displayed. This is the default behavior.
/on (NTXP)
Specifies that nothing is displayed. By default, only the differences will be listed.
/os (NTXP)
Specifies that only matches are displayed. By default, only the differences will be listed.
-q (NT4)
Very quiet, just print the number of differences.
/S (NT4)
Query all subkeys.
(NTXP)
Copies all subkeys and entries under the specified subkey.
/s separator (NTXP)
Specifies the character used to separate multiple instances of data. Used when REG_MULTI_SZ is specified as the data type and more than one entry needs to be listed. If not specified, the default separator is \0.
/se separator (NT2003)
Specifies the single value separator for which to search in value names of type REG_MULTI_SZ. If Separator is not specified, "\0" is used.
/size (NT4)
Query the size of RegistryPath.
-t data_type (NTXP)
Specifies the data type for the value of the entry:
-v entry_name (NTXP)
Specifies the name of the entry to be added/deleted under the specified subkey.
-va (NTXP)
Deletes all entries under the specified subkey. Subkeys under the specified subkey are not deleted.
-ve (NTXP)
Specifies that the entry that is added/deleted to the registry has a null value.
-y (NT4)
Force case sensitivity for REG FIND SearchStr.
Overwrites any existing file with the name file_name without prompting for confirmation for REG EXPORT and REG SAVE.
-z (NT4)
Find non-Unicode-compliant entries or entries missing a trailing null character (forces case sensitity).
(NT2003)
REG QUERY: Specifies to include the numeric equivalent for the registry type in search results.
-zR (NT4)
Adjust entry to add Unicode compliancy or the missing null char.

Related

SETX - Set environment variables permanently.
REGEDIT - Load Registry settings from a .REG file.
REGEDT32.EXE - Edit the registry including Security and Auditing Options.


Notes

none.


Examples

none.


Errorlevels
Availability
External Resource Kit
DOS
none
Windows
none
Windows NT
NT4 NTXP