Home > Articles

Editing with Regedit

Exporting and Importing

Exporting the Registry creates a text file with the .reg extension that you can edit using any text editor. This file contains all the information required to describe the subkeys and values in the subkey you export; in fact, you can import a REG file back into the Registry. When you export a subkey, Regedit writes all of that subkey's descendent subkeys and values. No means is available to export a single subkey without its descendents.

Up to this point, you've used Regedit to work with the Registry. You can also export subkeys to a REG file and edit them using a text editor such as Microsoft Notepad. For example, use the editor's search-and-replace feature to make massive changes to the REG file. Beware, however, because you can inadvertently change values you don't mean to change. More common is editing a REG file to remove subkeys and values that you don't want in the file. If you want to create a REG file that includes a subkey without all its descendent subkeys, for example, edit the file to remove the descendent subkeys. Here's a more practical example: Fergus customized Microsoft Windows 2000 Professional on one computer and then exported the subkey HKCU\Control Panel\desktop to a REG file. Because Fergus is using the REG file to customize other computers and is only interested in a handful of values, he removes the values and subkeys he doesn't want to include in it.

TIP

REG files are indeed a great way to share customizations with other users. After you've edited the file to remove unnecessary subkeys and values, distribute the file. If you want to distribute the file to network users, send it to them as an attachment to a message. Better yet, you can add a command to their logon script that automatically imports the file, put a link to the file on a Web page, or create a network share that contains many REG files from which users can choose. See Chapter 10 for more information.

Aside from editing subkeys and values with a text editor and sharing customizations, exporting subkeys to a REG file has more immediate practical purposes. Export as a backup any subkey in which you're working. When confusion clouds your mind or edits get out of hand, import it back into the Registry to restore the original settings. This will restore values that you change and remove, but it won't remove values that you added to the Registry. Thus, if you added a value that prevents Windows 2000 from working properly, restoring a REG file won't fix the problem; you'll have to remove the new value yourself.

Exporting

Here's how to export all or part of the Registry:

  1. In the key pane, click the subkey at the top of the branch that you want to export to a REG file.

  2. On the Registry menu, click Export Registry File.

  3. You see the Export Registry File dialog box shown in Figure 3.6. This dialog box works like most of the other common dialog boxes.

    Figure 3.6 The Export Registry File dialog box is similar to other common dialog boxes except for the Export Range area.

  4. In File Name, type the name of the file into which you want to export the Registry.

  5. In the Export range area, do one of the following:

    • To export the entire Registry, click All.

    • To export the subkey, click Selected Branch.

Regedit supports two formats for REG files, version 4 and version 5. Earlier versions of Regedit only supported version 4 REG files but Windows 2000's thorough support of Unicode requires the addition of version 5. Version 4 REG files are ANSI text files, whereas version 5 REG files are Unicode text files. When Regedit writes REG_EXPAND_SZ and REG_MULTI_SZ values to version 4 REG files, both of which Regedit encodes as binary in a REG file, it uses ANSI character encoding. When writing the same values to version 5 REG files, it uses Unicode character encoding.

The differences are only significant when you work with different operating systems. Version 5 REG files are only compatible with Windows 2000 and many text editors can't properly edit them. If you must create REG files that are compatible with earlier versions of Windows or your text editor doesn't support Unicode character encoding, create version 4 REG files. Note also that certain values are easier to edit in version 4 REG files. The last caveat, and the most important one for my international readers, is that you must use version 5 REG files if the registry contains multilingual data.

You specify which type of REG file you're creating in the Export Registry File dialog box. In the Save as Type list, click the type of REG file you want to create. Registration Files are version 5 REG files and Win9X/NT4 Registration Files (REGEDIT4) are version 4 REG files. Clicking All Files (*.*) creates version 5 REG files.

NOTE

Make sure that you use clear 8.3 names for REG files. Clear names help you find these files at the MS-DOS command prompt, and 8.3 filenames help make sure that you can easily use the name in command-line options.

Importing

Typical in Windows 2000, you can import a REG file more than one way. The first is the most useful and allows you to import the file without starting Regedit. Click Merge on the file's shortcut menu or, easier yet, double-click the file. If you use this method to import a REG file while Regedit is open, make sure you press F5 to refresh the display so that Regedit reflects changes. The second method uses Regedit:

  1. On the Registry menu, click Import Registry File.

  2. In the Import Registry File dialog box, select the REG file you want to import into the registry.

  3. Click Open.

  4. Regedit displays a message that says Information in filename has been successfully entered into the Registry after importing the REG file.

Import isn't the best name for this feature; merge is better. Regedit merges the REG file's contents into the Registry, replacing existing items and adding new ones. It does not remove subkeys or values that exist in the Registry but not in the REG file; it only adds new items and updates existing ones. Just keep in mind that importing a REG file is not the same as synchronizing a REG file with the Registry. If you must remove a subkey or value from the Registry, remove it using Regedit or write a script that removes it.

Be careful not to accidentally double-click a REG file. Regedit will automatically merge it into the Registry, as Merge is the default command for REG files. To avoid this problem, change the default command for REG files, as described in Chapter 7. You can also save REG files using a file extension other than .reg, preventing accidents. Also consider organizing REG files in their own folder, so that you're more inclined to be careful when working with files in that folder.

CAUTION

Nothing prevents you from importing a Windows 98 or Windows NT 4.0 REG file into Windows 2000, and vice versa. Don't because it might prevent either operating system from working properly. The content of each operating system's registry is sufficiently different for me to jump up and down and wave my arms madly while I give you this warning.

Reading REG Files

REG files look much like classic INI files and are easy to inspect. Open REG files in Notepad by clicking Edit on their shortcut menus. The first line of a version 5 REG file always contains Windows Registry Editor version 5.00, which identifies the file as a REG file. Version 5 REG files start with REGEDIT4. Following a single blank line, the remainder of the file contains the keys and values Regedit exported.

Listing 3.2 shows a REG file. It contains multiple sections. Each subkey is in its own section. The fully qualified name of each subkey is between square brackets. Each subkey's values are in the subkey's section. Except for default values, values' names are in quotation marks. Regedit represents in REG files default values using a single at sign (@). Values' data look different depending on their types (see Table 3.3). Anatomy lesson over.

Listing 3.2  A Sample REG File

Windows Registry Editor version 5.00


[HKEY_CURRENT_USER\Control Panel\Desktop]
"DragFullWindows"="1"
"FontSmoothing"="1"
"wallpaper"=""
"TileWallpaper"="0"
"UserPreferencemask"=hex:a0,00,00,00
"WallpaperStyle"="0"
"ScreenSaveLowPowerActive"="1"
"ScreenSavePowerOffActive"="0"
"ScreenSaveActive"="0"
"ScreenSaveTimeOut"="60"
"ScreenSaveUsePassword"=dword:00000000
"SmoothScroll"=hex:01,00,00,00
"WheelScrollLines"="3"
"Pattern"=""
"DragWidth"="2"
"DragHeight"="2"
"DoubleClickWidth"="4"
"DoubleClickHeight"="4"
"HungAppTimeout"="inget"
"WaitToKillAppTimeout"="inget"
"CoolSwitchRows"="inget"
"CoolSwitchColumns"="inget"
"MenuShowDelay"="400"
"test"=dword:00000054

[HKEY_CURRENT_USER\Control Panel\Desktop\ResourceLocale]
@="00000409"

[HKEY_CURRENT_USER\Control Panel\Desktop\WindowsMetrics]
"MinAnimate"="1"

Table 3.3  Format of Values in REG Files

Data Type

Version 4

Version 5

REG_BINARY

hex:00,00,00,01

hex:00,00,00,01

REG_DWORD

dword:00000001

dword:00000001

REG_EXPAND_SZ

hex(2):48,49,00

hex(2):48,00,49,00,00

REG_MULTI_SZ

hex(7):4C,69,6E,65,20,

hex(7):4C,00,69,00,

31,00,4C,69,6E,65,20,

6E,00,65,00,20,00,31,

 

32,00,00

00,00,00,4C,00,69,00,

 

 

6E,00,65,00,20,00,32,

 

 

00,00,00,00,00

 

REG_SZ

"A string"

"A string"


Protecting Yourself

I can't stress enough the importance of protecting yourself while editing the Registry. You can restore a backup copy of the Registry, but less-drastic solutions are more feasible. Create a backup copy of a value before changing it, for example, by creating a backup value and naming it whatever you like. Then copy the original value to the Clipboard and paste it to the backup value. You'll always know what data you replaced in the value.

If you're working with a number of values within a subkey, export the subkey to a REG file before editing it. If things go wrong, import the file to restore the subkey's settings. You can replace the mangled subkey by removing it before importing the REG file.

A sorted combination of Regedit and Regedt32 is often the best solution. Regedit is the easiest of the sibling Registry editors to use, but Regedt32 has more powerful features for backing up subkeys. Use Regedt32 to save subkeys as hive files and use Regedit to edit the Registry. Flipping back and forth between both programs might seem silly, but you get used to the idea quickly. Just make sure you refresh either program's window if you make changes to the registry using the other.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020