IT tutorials
 
Technology
 

Windows 7 : Troubleshooting Software Problems (part 2) - Editing the Registry

8/10/2013 5:52:39 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

5. Editing the Registry

After researching a software problem, you might find that the solution involves a "registry hack," also known as editing the registry. This is serious business with little margin for error. Never attempt to fix a problem by guessing at a registry hack. When you do get specific instructions on making a registry change, make sure you make exactly the change indicated in the message. Even the slightest typographical error can cause a world of problems. If you're not a technical person and don't want to risk creating a really big mess you can't rectify, consider hiring a professional to resolve the problem.

Before you launch into registry hacking, you need to understand what you're doing. First, be aware that the registry is a database where Windows and other programs store data that they need to operate properly on your computer. The average computer user typically doesn't need to know that the registry exists. In fact, I'm sure most do not. There is absolutely nothing that's "user friendly" about the registry. In fact, it's probably just about as "user hostile" as you can get. Microsoft provides the Registry Editor described in this chapter because programmers and other IT professionals occasionally need to view or modify registry entries.

The registry is not a safe place to mess around. Pay attention to all cautions in this chapter!


5.1. How Registry Data is Organized

The Windows registry comprises several hives, each of which holds specific types of data. Within each hive, the registry uses keys and subkeys to organize data. Just as a folder can contain subfolders, a key can contain subkeys.

The registry doesn't store files or documents, however. Rather, it stores values. Some of these values make sense to the average user, but some do not. For example, if you have Microsoft Office installed, there is a value in the registry that stores the path to the Office installation folder, and the value is typically C:\Program Files\Microsoft Office\Office 12\. That's easy to understand. However, you'll also find a lot of values in the registry that look something like {89820200-ECBD-11cf-8B85-00AA005B4383}!8,0,7100,0, and it's highly unlikely that this value will mean anything to you. But whether or not the value of a given registry entry makes sense to you, they make sense to the application that is using the value, and that value must be entered exactly as required.

5.1.1. Hives, keys, and subkeys

I get into the specifics of editing the registry in a moment. But first, Figure 1 shows an example of the Registry Editor as it might look when you first open it. The names listed down the left column are hives. As defined by Microsoft, a hive is a logical group of keys, subkeys, and values in the registry that has a set of supporting files containing backups of its data. So, each hive contains keys, subkeys, and data. Each hive stores a particular type of information, as summarized in Table 1. Note that most keys have a standard abbreviation, such as HKCU for HKEY_CURRENT_USER.

To open Registry Editor, click Start, type regedit, and press Enter.


Figure 1. Standard hives at left in the Registry Editor.

When you click the white triangle next to a hive, it expands to display its key. Most of the keys have subkeys, and those subkeys might also have subkeys of their own. In that case, the subkey itself will have a white triangle too, which you can click to see another level of subkeys. For example, in Figure 2, I've expanded the HKEY_CLASSES_ROOT key to reveal its subkeys. Each subkey represents a particular file type in that case. I've also expanded a few subkeys in that example.

You'll often see a reference to a specific subkey expressed as a path, in much the way that you might see a file's location and name expressed as a path. For example, the path to a file might be expressed as C:\Users\jboyce\Pictures\Summit01.jpg. The path tells Windows exactly where to find the file Summit01.jpg in my Pictures folder.

A registry path is the same idea, and even uses backslashes to separate the key and subkey names. For example, the highlighted subkey in Figure 2 is at Computer\HKEY_CLASSES_ROOT\.3g2\OpenWithProgIds.

Table 1. Standard Root Keys
NameAbbreviationDescription
HKEY_CLASSES_ROOTHKCRStores information about document types and extensions, registered programs that can open each file type, the default program for each file type, and options that appear when you right-click an icon.
HKEY_CURRENT_USERHKCUStores information about the person who is currently using the computer, based on which user account that person is logged in to, and settings that particular user chose within his or her account.
HKEY_LOCAL_MACHINEHKLMStores information about all the hardware that's available to the computer, including devices that might not be plugged in at the moment.
HKEY_USERSHKUStores information about all users, based on user accounts you've defined via Control Panel.
HKEY_CURRENT_CONFIG<none>Similar to HKEY_LOCAL_MACHINE, this key stores information about hardware available to the computer. However, this key limits its storage to hardware that's connected and functioning currently.

Sometimes you'll see instructions telling you the path to a key or subkey, like HKEY_CURRENT_ USER\Control Panel\Appearance\Schemes. You have to manually expand each folder down the path to get to the subkey. Figure 3 shows the result of following that sample path. The values in the Data column for that key are mostly binary numbers; a good example of just how user unfriendly the registry can be!

5.1.2. Key values

The data stored in a subkey is called a value. The value is a specific piece of information that can be stored as a string (text) or a number. However, the terms "string" and "number" don't tell the whole story, because those types can be further broken down into the specific data types listed in Table 2.

In the vast majority of situations, you'll be working with strings, DWORDs, or QWORDs when you create or modify registry entries. Entering a string in the registry is just like entering a string in a text box. When you enter DWORD and QWORD values, however, you enter those either as a decimal or a hexadecimal value. I won't go into detail about the differences here, and if you want a clearer understanding of hexadecimal numbering, a quick search on the Web will turn up lots of explanations and examples. Just keep in mind that when you edit a DWORD or QWORD value, you need to choose the option that matches the value you are entering. Figure 4 shows an example of a value entered as a decimal number.

Figure 2. The HKEY_CLASSES_ROOT and some subkeys expanded.

Figure 3. The HKEY_CURRENT_USER\Control Panel\Appearance\Schemes subkey selected.

Table 2. Registry Value Data Types
NameData typeDescription
Binary ValueREG_BINARYRaw binary data used mostly by hardware components. Often displayed in hexadecimal format.
DWORD ValueREG_DWORDAn integer often used to store parameters for device drivers and services. Subtypes include related types such as DWORD_LITTLE_ENDIAN and REG_DWORD_BIG_ENDIAN with the least significant bit at the lowest/highest address, respectively.
Expandable String ValueREG_EXPAND_SZA variable-length string often used to store data for application programs and services.
Multi-String ValueREG_MULTI_SZA string that actually consists of multiple substrings separated by spaces, commas, or other special characters.
String ValueREG_SZA simple fixed-length text string.
Binary ValueREG_RESOURCE_LISTA series of nested arrays (lists) often used by hardware and device drivers. Usually displayed in hexadecimal.
Binary ValueREG_RESOURCE_REQUIREMENTS_LISTA series of nested arrays (lists) containing a device driver's hardware resources, displayed in hexadecimal.
Binary ValueREG_FULL_RESOURCE_DESCRIPTORA series of nested lists of actual hardware device capabilities, usually displayed in hexadecimal.
NoneREG_NONEData with no particular type that's displayed as a Binary Value in hexadecimal.
LinkREG_LINKA string naming a symbolic link.
QWORD ValueREG_QWORDA 64-bit number displayed as a binary value.

Figure 4. The Edit DWORD (32-bit) Value dialog box.

If the troubleshooting steps that you are using direct you to enter a decimal value, click the Decimal option and then type the value specified. If you need to enter a hexadecimal value, click the Hexadecimal option before you type the value.

5.2. Backing up the registry

Every time you start your computer, Windows automatically creates the registry based on the hardware and software available to it. Then, it makes a backup copy of that registry. When you plan to manually change the registry, you should also make a backup copy of the registry just before you make your change. Because when it comes to editing the registry, there is no margin for error and even a tiny typographical error can have far-reaching, unpleasant consequences.

You need administrative privileges to edit the registry. The program you use is named regedit. You can start it using either of these methods:
  • Tap , type regedit, and click regedit.exe on the Start menu.

  • Click the Start button, choose Run, type regedit, and press Enter.

NOTE

If you don't have a Run option on your Start menu, you can add it. Right-click the Start button and choose Properties. Then click Customize, check Run Command in the list of programs, and click OK in each open dialog box.

The Registry Editor opens. You always want to make a backup of the registry before you change anything. It's easy to do:

  1. Choose File => Export from the menu bar in the Registry Editor.

  2. Choose a folder and enter a filename of your own choosing.

  3. To export the entire registry, choose All under the Export Range heading.

  4. Click the Save button.

That's it. In the event of a disaster, you can choose File => Import from the Registry Editor's menu bar to restore all the entries you copied in the preceding steps.

5.3. Making the registry change

You can change any value in the registry. First you need to get to the appropriate subkey. For example, let's say that you've found the solution to some problem via Microsoft's Web site. Part of that solution involves changing a value in the following subkey:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

The first step is to get to the subkey by expanding the HKEY_LOCAL_MACHINE, SOFTWARE, Microsoft, Windows, and CurrentVersion node. Then click Run. The pane to the right shows values in the subkey. The status bar shows the complete path name as in Figure 5.

Figure 5. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run selected.

To change a subkey's value, double-click that value. A dialog box will open allowing you to make a change. The appearance of the dialog box depends on the type of value you're editing. Figure 6 shows a general example.

Make sure you get to the correct key, and make exactly the change your instructions tell you to. Even the slightest mistake here could cause big problems down the road.


The Value Data box contains the value you can edit. Make your change there and click OK. Then close the Registry Editor. You have finished making your registry change.

Figure 6. Dialog box to edit a DWORD value.

Whether or not you see any change on the screen depends on the value you changed. Many registry hacks will have no effect until you close the Registry Editor, close all open program windows, and restart the computer.

If it turns out you created more problems than you solved, you can restore your registry from the backup you make. Open the Registry Editor and choose File => Import to import the backed-up file. Otherwise, if all seems well, you can delete the backed-up registry file.

 
Others
 
- Windows 7 : Troubleshooting Software Problems (part 1)
- Windows Server 2012 Overview : Boot Configuration (part 5) - Managing the Boot Configuration Data store and its entries - Changing the operating system display order
- Windows Server 2012 Overview : Boot Configuration (part 4) - Managing the Boot Configuration Data store and its entries - Setting BCD entry values
- Windows Server 2012 Overview : Boot Configuration (part 3) - Managing the Boot Configuration Data store and its entries - Viewing BCD entries
- Windows Server 2012 Overview : Boot Configuration (part 2) - Boot environment essentials, Managing startup and boot configuration
- Windows Server 2012 Overview : Boot Configuration (part 1) - Boot from hardware and firmware
- Windows Phone 8 : Media and Picture Hubs (part 3) - Integrating into the Pictures Hub, Integrating into the Music and Videos Hub
- Windows Phone 8 : Media and Picture Hubs (part 2) - Accessing Pictures, Storing Pictures
- Windows Phone 8 : Media and Picture Hubs (part 1) - Accessing Music, Playing Music
- Active Directory 2008 : Managing an Enterprise with Groups (part 4) - Developing a Group Management Strategy
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us