Home > Articles

Editing with Regedit

Working with Keys and Values

The following sections show how to use Regedit to search, add, change, delete, and print configuration data. Before continuing, heed this advice: Back up the Registry before making changes that might harm the computer.

As is the case with most Microsoft programs, Regedit provides numerous ways to access each feature. Subkeys' shortcut menus have commands to rename, delete, and create new subkeys under them. Values' shortcut menus have commands to change, delete, and rename them. The main menu has similar commands that apply to the selected subkey or value. Of course, you can always edit a value by double-clicking its name in the value pane, and you can always use the keyboard shortcuts you learned about in Table 3.2, earlier in this chapter.

Searching

Regedit searches for subkeys, value names, and value data that match the text for which you're looking. It searches for full and partial matches. For example, Windows 2000 and Windows 98 both match the search string Windows. Use the search feature to find values relating to a specific product, find all values that reference a specific file, or locate values related to a particular device. Users frequently send me messages asking what value contains a particular bit of configuration data, such as usernames. My reply is usually to search the Registry for their names, and they're likely to find it. Here's how to search subkeys, value names, and value data for a particular string:

  1. On the Edit menu, click Find.

  2. Regedit opens the Find dialog box in Figure 3.3.

    Figure 3.3 In the Look At area, deselect the portions of the Registry in which you don't want to search.

  3. In Find What, type text for which you're looking.

  4. If you're searching for numbers in string values, try the decimal and hexadecimal notations because both formats are common in the Registry.

  5. Click Find Next, and Regedit begins searching beginning with the selected subkey.

  6. This sometimes takes a while—up to several minutes on slower machines. Regedit displays an hourglass while it's searching. If it finds a matching subkey, it selects that subkey in the key pane. If it finds a matching value, it opens in the key pane the subkey containing the value and selects the value in the value pane.

  7. Press F3 to continue searching.

  8. Regedit looks for the next matching subkey or value. When Regedit reaches the bottom of the Registry, it displays a message that says Finished searching through the Registry.

You can hasten the search if you know what portion of the Registry contains the string for which you're searching: subkeys, value names, or value data. In the Look At area, clear the Keys, Values, or Data check boxes if you don't want to search in one or more of those places. If you're pretty certain that the string you're finding is in a value's name, for example, deselect Keys and Data to limit Regedit to value names, speeding up the search. Limiting a search to subkeys can cut by half the amount of time the search takes. Also, selecting the Match Whole String Only check box when you don't want Regedit to search for partial matches speeds up the search, or so you'd think. But timing searches using this check box, I found otherwise. It makes no appreciable difference in the time Regedit takes to search the registry, so use this check box only to limit the number of matches. The following table illustrates some of my tests searching for a bogus string that's not in my computer's Registry:

Time

Description

150 seconds
Searching subkeys, value names, and value data for full and partial matches
75 seconds
Searching subkeys for full and partial matches
75 seconds
Searching subkeys for full matches only

A limitation of Regedit is that it only searches string values, not REG_BINARY, REG_DWORD, or other binary values. You simply can't search for 0x000000001 and expect Regedit to find matching REG_DWORD values. You can still locate these values, however, by exporting the Registry to a text file and searching the text file with your favorite editor. See the later section "Exporting and Importing" to learn how to export the Registry to Registration Entries (REG) files. What you need to know is how those values look in a REG file so you can search for them using a text editor. The only drawback is that you must convert strings to hexadecimal before searching binary values for strings. The following table shows the format of REG_BINARY, REG_DWORD, and REG_SZ values in the registry and in REG files:

Type

Format in Regedit

Format in REG File

REG_BINARY

a0 00 00 01

hex:a0,00,00,01

REG_DWORD

0x00000054

dword:00000054

REG_SZ
Jerry Honeycutt
"Jerry Honeycutt"

For example, if you were searching for the REG_DWORD value 0xA0B0C0D0, you would search the REG file for dword:A0B0C0D0. If you were searching for the binary value 0x052059021465, you would search the REG file for the string hex:05,20,59,02,14,65. To search for the string "Hi" in binary values, you would search for the string hex:48,69, its hexadecimal equivalent. Note that Regedit exports values other than REG_BINARY, REG_DWORD, and REG_BINARY as binary values, so search for strings in those types of values as though they were REG_BINARY.

Search Techniques

After getting to know the Registry, you should be able to predict where to find certain subkeys and values. With that knowledge, you can select a subkey somewhere near where you think you'll find the item and then use the search feature to find it. This takes much less time than searching the entire Registry for the item.

Here's an example. If searching for a file extension, open HKCR and do an incremental search to locate it more quickly. You can locate the program identifier associated with a file extension, which defines the commands available for the file, by looking at the file extension's default value.

Finding a program's configuration data is straightforward because most programs store the same types of data in similar places. File associations are in HKCR. Programs store settings in Software\Vendor\AppName\Version under HKLM and HKCU, where Vendor is the name of the company that produced the software, AppName is the name of the application, and Version is the version number of the program, CurrentVersion in many cases.

Recall that per-computer configuration data is in HKLM, and per-user data is in HKCU. Use that information to your advantage. If you're certain that the configuration data for which you're searching is computer-specific, select HKLM before searching. You'd search for any information about a particular device in this root key, for example. Otherwise, if you're certain the data is user-specific, select HKCU before searching.

Changing Values

To change a value, double-click it in the value pane, or select it and then click Modify on the Edit menu. When you open a value, Regedit displays a different dialog box, depending on the value's type. Regedit opens REG_BINARY, REG_DWORD, and REG_SZ values in the Edit Binary Value, Edit Dword Value, and Edit String dialog boxes, respectively. For values of types other than REG_DWORD and REG_SZ, Regedit opens them in the Edit Binary Value dialog box, so you're better off editing those values using Regedt32. The remainder of this section describes how to edit each type of value.

Using the Edit String dialog box to edit REG_SZ values is uneventful. In Value Data, change the string. Select the entire string and type over it to replace its contents. Also, the cut-and-paste feature is available in Value Data. Don't add quotation marks to the value unless you want to embed them in the actual string.

Regedit opens REG_DWORD values in the Edit DWORD Value dialog box, shown in Figure 3.4. Know the hexadecimal value? Type it in Value Data. If you want to enter the hexadecimal value 0x1234, type 1234, omitting prefixes that typically identify hexadecimal values. If you don't know the hexadecimal value, click Decimal, type the value in decimal notation, and let Regedit convert it for you. Here's a bonus: In the value pane, Regedit displays REG_DWORD values using both notations (decimal notation is in parenthesis).

Figure 3.4 Choose Decimal if your hexadecimal math is a bit rusty. Regedit will convert the value to hexadecimal notation.

Figure 3.5 shows the Edit Binary Value dialog box, which Regedit opens when you edit anything other than REG_DWORD and REG_SZ values, including REG_BINARY values. In Value Data, you see three different columns of information. The first column shows the hexadecimal address of the first byte in that row. For instance, 0010 means that the first byte in that row of binary data is the 16th byte. The second column contains the actual binary data, which you read left-to-right and top-to-bottom. The third column shows the ASCII-character equivalent of each byte in the second column. You can edit values in either the second or third columns. Position the cursor anywhere in the second column and type hexadecimal digits, 0 through F. Position the cursor in the third column and type ASCII characters. No matter in which column you're editing, Regedit updates the other column after each change. In either column, you can select bytes and type over them to replace them with new bytes.

Figure 3.5 The Edit Binary Value dialog box shows decimal values converted to hexadecimal values using Windows calculator in scientific mode.

One capability—I don't call it a feature—is that you can select the value's name in Value Name and copy it to the Clipboard. This works for each of the Edit Type dialog boxes and is a useful sanity-saver when writing about the Registry. It ensures that I get value names correct. It's also useful to make sure you spell value names correctly when creating scripts. If you missed the tip about copying subkey names to the Clipboard, you do so by clicking Copy Key Name on the shortcut menu. The sidebar, "Clipboard Techniques," later in this chapter, describes other ways to use the Clipboard in Regedit.

Windows 2000 or running programs might not immediately reflect changes you make to the Registry. To make sure they do reflect your changes, cause them to reread those values from the Registry. If you change values in HKLM, for instance, you might have to restart the computer in order for Windows 2000 to recognize them. If you change values in HKCU, you might have to log off and back on again. You can make most programs recognize changes by closing and restarting them. This is true except for services that start when the operating system starts. In those cases, you must stop and start the services or restart the computer to see your changes at work.

CAUTION

Use a bit of caution when changing values. The later sidebar "Protecting Yourself" provides some good tips for backing up the portions of the Registry in which you're working. This helps you recover from any problems that your edits might cause. The best I can offer when editing a value is to copy it by giving the original value an obscure name. Then add a new value that has the original name and value. If things go awry, you can remove the new value and restore the original from the backup.

Creating Keys and Values

Creating new subkeys or values is generally harmless and equally useless, unless, of course, you know for sure that Windows 2000 or another program will use them. It's the equivalent of an Easter egg hunt. You wouldn't hide Easter eggs in places that nobody will look because they won't find them. Likewise, don't hide subkeys and values in places that no programs will look because it's a futile exercise. So why create new subkeys or values? Microsoft's Knowledge Base frequently instructs users to create new values to fix varieties of problems. Chapter 7, "Customizing Windows 2000," describes a plethora of subkeys and values you can add to the Registry. Valid reasons for adding subkeys and values abound.

When you create new subkeys, Regedit creates a subkey called New Key #N, where N is a number starting with 1, and selects its name so you can rename it. When you create a new value, Regedit creates a value called New Value #N and also selects its name so you can rename it. In both cases, Regedit increments N to ensure that the subkey or value is unique within its scope, its parent subkey. Regedit sets the initial value of new REG_SZ values to an empty string, REG_BINARY values to an empty binary string, or REG_DWORD values to zero. Change the value as described in the preceding section.

To create new subkeys or values, do one of the following:

  • Select the subkey under which you want to create a new subkey. On the Edit menu, point to New, and click Key; then, type the name of the subkey.

  • Select the subkey under which you want to create a new value. On the Edit menu, point to New and then click String Value, Binary Value, or DWORD Value. Type the name of your new value. Edit the value as described in the preceding section.

Clipboard Techniques

Use the Clipboard to make tasks easier. You can copy to and paste from the Clipboard whenever you edit a subkey's name or value's name or data. Thus, consider these different ways to use the Clipboard in Regedit:

To copy the fully qualified name of a subkey to the Clipboard, click Copy Key Name on the subkey's shortcut menu.

To copy a value's name to the Clipboard, double-click the value to edit it. In Value Name, select the value's name and then press Ctrl+C to copy it to the Clipboard. Click Cancel to avoid changing the value accidentally.

To copy a value's data to the Clipboard, open the value to edit it. In Value Data, select the data, and then press Ctrl+C to copy it to the Clipboard. Click Cancel to avoid changing it accidentally.

To paste data from the Clipboard into a value, double-click the value to edit it, select the data you want to replace, and then press Ctrl+V.

To copy a subkey or value's name to the Clipboard, click Rename on the item's shortcut menu, and then press Ctrl+C to copy it to the Clipboard.

The third item in the list tells how to copy a value's data to the Clipboard. Use this technique to back up a value before changing it. Copy the value's data to the Clipboard and paste that data into a new value that has a bogus name. If you want to restore the original value, copy the backup data to the Clipboard and paste it back into the value.

Deleting Keys and Values

Be careful about deleting subkeys and values. You'll likely prevent Windows 2000 from working properly by deleting configuration data carelessly. To remove a subkey or value, follow these steps:

  1. Do one of the following:

  2. In the key pane, select a subkey.

    In the value pane, select a value.

  3. Press Delete.

  4. Regedit prompts you to confirm that you want to delete the subkey or value.

  5. Click Yes to delete the subkey or value.

A common use for deleting subkeys and values is to restore programs' default settings. This doesn't always work with large programs that choke when their settings are missing but works well with small programs that re-create their settings. For example, you learned how to remove Regedit's settings from the Registry to restore its configuration. Another example is removing .txt from HKCR\Software\Microsoft\Windows\CurrentVersion\Explorer\ FileExts in order to remove customizations to text files' shortcut menus.

Renaming Keys and Values

Renaming subkeys and values in Regedit is much like renaming folders and files in Windows Explorer, except you can't rename selected items by clicking their names. Instead, select the subkey or value you want to rename, click Rename on the Edit menu, and then type over the name to change it. Better yet, select the subkey or value, press F2, and then type over the name.

Renaming subkeys and values has a practical purpose. It's a good way to hide configuration data prior to deleting it permanently. Hiding items under obscure names is logically the same as removing them because no program knows to look for them if you give them funky names. If things go awry, however, you can restore items' original names to undelete them. For example, assume you want to remove IsShortcut from the lnkfile program identifier, which prevents Windows 2000 from displaying an overlay on shortcuts' icons. Instead of deleting the value, rename it to something like MyIsShortcut and test the change. Permanently remove MyIsShortcut after you're satisfied that everything works okay (seldom true in this case).

TIP

Renaming subkeys and values is a smart way to document your data that you delete. If you forever leave items in the Registry with obscure names, you'll always know what those items originally contained. The same goes for changing a value. Note the value's name and data before renaming it to some obscure name. Create a new value with the name and data you noted. Now you have one copy of the value you can change and one copy of the value serving as a reminder of its original contents.

Printing Subkeys

Some folks think printing the Registry is useful as a backup tool or for reading the Registry to better understand it. Considering that a full printout of the entire Registry would occupy hundreds of pages and that you can't import a printout back into the Registry, this position is nonsense.

Printing a small subkey does have merit, however. It serves as a useful guide when working within small portions of the Registry. You can restore the original data if you foul up, and it serves as a guide for the types of data that belong in each value. Also, it is sometimes helpful to print a small portion of the Registry that you need as a reference when working in another part of the Registry. This is particularly true because you can't open two copies of Regedit to view two portions of the Registry at the same time. Having a printout of a subkey keeps you from moving hither and thither between two distant subkeys.

To print a subkey, select it in the key pane, and then click Print on the Registry menu. Regedit includes the entire branch, beginning with that subkey, and sends the print job to the spooler. The resulting output looks almost similar to a REG file, as shown in Listing 3.1. The format is slightly different, however. Regedit doesn't put quotation marks around string values, for instance. It also doesn't prefix binary values with the string hex:. The most notable difference is that it writes REG_DWORD values as REG_BINARY values, reversing the bytes as required in a little-endian architecture (see Chapter 1). The following table describes how Regedit formats each data type when it prints it:

Type

Format in Regedit

Format in Printed Output

REG_BINARY
A0 00 00 00 01 23
A0,00,00,00,01,23
REG_DWORD
0x00000054
54,00,00,00
REG_SZ
"This is a string"
This is a string

Listing 3.1  Regedit Printer Output

[HKEY_CURRENT_USER\Control Panel\Desktop]
 DragFullWindows=1
 FontSmoothing=1
 UserPreferencemask=a0,00,00,00
 ScreenSaveUsePassword=00,00,00,00
 SmoothScroll=01,00,00,00
 MenuShowDelay=400
          
[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]
MenuWidth=-270
MenuHeight=-270
MinAnimate=0
Shell Icon Size=32
IconTitleWrap=0
test=01,00,00,00
          
[HKEY_CURRENT_USER\Control Panel\Desktop\WindowsMetrics]
MinAnimate=1

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