fortypoundhead.com

REGEDIT

Posted On 2007-04-24 by FortyPoundHead
Keywords: Command Reference Registry
Tags: Windows Commandline Windows
Views: 1578


Import, export or delete registry settings from a text (.REG) file

Syntax
Export the Registry (all HKLM plus current user)
REGEDIT /E pathname

Export part of the Registry
REGEDIT /E pathname "RegPath"

Import a reg script
REGEDIT pathname

Silent import
REGEDIT /S pathname

Start the regedit GUI
REGEDIT

Open multiple copies of GUI (XP and 2003 only)
REGEDIT -m

Key
/E : Export

/S : Silent ImportHow to add keys and values from the registry:

Create a text file like this:

REGEDIT4
[HKEY_CURRENT_USER\SomeKey]
"SomeStringValue"="Hello" When double clicking this .reg file the key and value will be added.
Alternatively run REGEDIT MYKEY.REG from the command line.

How to delete keys and values from the registry:

Create a reg file like this, notice the hyphen inside the first bracket

REGEDIT4
[-HKEY_CURRENT_USER\SomeKey] When double clicking this .reg file the key "SomeKey" will be deleted along with all string, binary or Dword values in that key.

If you want to just delete values leaving the key in place, set the value you want to delete = to a hyphen
e.g.

REGEDIT4
[HKEY_CURRENT_USER\SomeKey]
"SomeStringValue"=-
Again double clicking this .reg file will delete the values specified - or you can use REGEDIT /s MyDeleteScript.REG.

Windows XP Registry files.
Under Windows NT all registry scripts start with:
REGEDIT4

Under Windows 2K and XP the first line is:
Windows Registry Editor Version 5.00

To be sure that a .REG script will run under any version of Windows use the earlier syntax: REGEDIT4.

Compare the Registry of two machines

Windiff is your friend, this simple GUI utility from the resource kit will list all the differences.

Comments
Within a registry file, comments can be preceded by "; "
e.g.
;
; Turn the NUMLOCK on at login
;
[HKEY_CURRENT_USER\Control Panel\Keyboard]
"InitialKeyboardIndicators"="2"


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