fortypoundhead.com

REG

Posted On 2007-04-24 by FortyPoundHead
Keywords: Command Reference NT Resource Kit W2K Support Tools
Tags: Windows Commandline Windows
Views: 1483


Read, Set or Delete registry keys and values

The REG command was updated in NT Resource Kit supplement 2 - the syntax for Win 2K/XP is different.

SYNTAX:

REG QUERY RegistryPath ["String"] [/S] [/size] [/list]

REG ADD RegistryPath=Value [DataType]
REG UPDATE RegistryPath=Value
REG DELETE RegistryPath [/FORCE]
REG COPY Source [\\Machine] Dest [\\Machine]

REG SAVE RegistryPath FileName
REG RESTORE FileName KeyName

REG LOAD FileName KeyName
REG UNLOAD KeyName

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

REG DUMP RegistryPath FileName

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

You can apply any of the above commands to a remote
machine by adding \\MachineName to the command line.

Key:

RegistryPath : [ROOTKEY\]Key[\''ValueName'']
where ROOTKEY is one of
HKLM = hkey_Local_machine (default)
HKCR = hkey_classes_root
HKCU = hkey_current_user
HKU = hkey_users

Key = The full name of a key under the selected ROOTKEY.

ValueName = The value, under the selected Key, to edit.
(default is all keys and values)
Enclose ValueNames that containe the \ character in single quotes.

DataType : REG_SZ | REG_DWORD | REG_EXPAND_SZ | REG_MULTI_SZ
(default = REG_SZ)

Machine : Name of remote machine - omitting defaults to current machine.
Only HKLM and HKU are available on remote machines.

Source : a RegistryPath in the format above.

Dest : a RegistryPath in the format above.

FileName : The filename to save to or restore from (without an extension.)

KeyName : A key name to load the hive file into. (Creating a new key)
specify the key name to UNload with: [ROOTKEY\]Key

/S Query all subkeys.

/size Query the size of RegistryPath

/list Search strings from RegistryPath

/FORCE Force a deletion without asking "are you are sure"

SearchStr : Value to search for.

ReplaceStr : Value to replace.

-y : Force case sensitivity for SearchStr

-z : Find non-Unicode-compliant entries or entries missing a trailing
null character. (forces case sensitity)

R : Adjust entry to add Unicode compliancy or the missing null char.

-o Omit screen output of:
M: Matches
D: Differences

-e 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.

-q Very quiet, just print the number of differences.notes:
On remote NT machines the file is written to the System32 directory.
On remote Win95 machines the file is written to the Windows directory.
SAVE is identical to BACKUP.

Examples

An example of each command is available from the command line

REG QUERY /?
REG ADD /?
REG UPDATE /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG BACKUP /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG FIND /?
REG DUMP /?
REG COMPARE /?


About the Author

FortyPoundHead has posted a total of 1974 articles.

 


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:54.224.50.28

Before you can post, you need to prove you are human. If you log in, this test goes away.




Recent Forum Posts

Advanced search added
dwirch posted on September 23, 2017 at about 13:44 in Site News

Job Spammer: Gaurav Mehta - AgreeYa Solutions
dwirch posted on September 22, 2017 at about 10:35 in Spammers

Job Spammer: Prutha Siri - Javelin Systems
dwirch posted on September 10, 2017 at about 6:15 in Spammers

New security implemented
dwirch posted on September 7, 2017 at about 7:16 in Site News

Malicious IP Checker Companion Tool
dwirch posted on August 12, 2017 at about 20:24 in Site News

Job Spammer: Steve Adams
dwirch posted on August 8, 2017 at about 7:44 in Spammers