The Registry is full of opportunities for improvement, and the real trick is in finding the information you want. Unfortunately, in REGEDT32.EXE for Windows NT, the only thing you can search for is a key. The search capability is a little better in REGEDIT.EXE for Windows 95 or Windows NT, but you give up a lot of security and features just to get the better searching. Neither REGEDIT.EXE or REGEDT32.EXE will allow you to do a search and replace.
Enter Registry Search and Replace, from Steven J. Hoek Software, a $20.00 shareware program. It can be used with Windows 95, Windows NT 3.51, and Windows NT 4.0. It works best with 95 and NT 4.0 because of the Explorer interface. Prior to installation of Registry Search and Replace, in order to do any searching in the Registry, you had to open the Registry editor and use the Find function. After you install the Registry Search and Replace program and restart your system, when you look in your Start menu under Find, you will see a new option to search the Registry. Figure 37.1 shows the Find Menu prior to the installation, and Figure 37.2 shows the menu after the new option is installed.
One of the best parts about the Registry Search and Replace is that it doesn't require the opening of a Registry editor. It is fast and easy, and well worth the $20.00.
Figure 37.1. The Windows 95 Start | Find menu.
Figure 37.2. The Windows 95 Start | Find menu including Registry Search and Replace.
To find any entry in the Registry, go to Start | Find | In the Registry...and enter your search criteria, as shown in Figure 37.3. Type in the data, select the precision of the matching, and choose whether you will replace the found information or not. Select Search to finish the criteria and start the search.
Any restriction of the type of search will speed the search by quickly eliminating alternatives. On the other hand, if you think you know the data you are looking for, entering a partial match will still work, and give you more possible matches to review.
Figure 37.3. Search criteria in Registry Search and Replace.
NOTE:Registry entries are not normally case-sensitive for functionality, but you may still want to use the option. For example, if a user typed his name in lowercase during installation of a product, you may want to search to find where that information is being stored.
Once the search is started, you will see the progress of the search as the program automatically switches to the Progress tab. Figure 37.4 shows a search in progress, and Figure 37.5 shows the results of the search. The program will stop at a found match, waiting for you to choose the OK button.
NOTE:Notice the button to start the Registry Editor in the lower right corner of Figure 37.5. Registry Search and Replace will start the editor, but unfortunately will not take you to the location you found automatically. You'll still have to navigate the Registry manually.
Figure 37.4. High-speed searching of the Registry.
Figure 37.5. Search results in Registry Search and Replace.
The Advanced tab allows you to select the handles keys to search through, and the types of data to look at. Figure 37.6 shows the Registry Criteria for the search. You can select whether to search for a value name or a data string. If you choose a data string, you can choose what type of data strings to look in. For example, if you knew that IP addresses assigned to your network card in Windows NT were listed in a REG_MULTI_SZ entry, you could select that and search using your IP address. You would select only the HKEY_LOCAL_MACHINE hive, in your local machine. The results would show you the exact location where those IP addresses are held. The search would be very fast, and focused on the specific item.
Alternatively, you can search for the same kind of information on a remote system as well, as shown in Figure 37.7.
Figure 37.6. Selecting the Registry Criteria for a search.
Figure 37.7. Remote searching of a Registry.
Once you have selected exactly the settings you want to use to do the searching, you can create a profile, so you would not have to manually make the settings again. The only thing you would have to enter is the data you want to search for.
Select the items in your search, click the Profiles tab, and select Save As. Enter the desired name of the profile, and click Save. The next time you want to use the same profile for a search, select the Profiles tab, click Open, and choose the name of the profile. Figure 37.8 shows the Open Profile dialog box.
Figure 37.8. Opening a profile for use in searching the Registry.
The previous features are certainly an improvement on the similar searching features found in REGEDIT.EXE and REGEDT32.EXE. There is no automatic replacement function in the Registry editors. The availability of a fast, easy, and ultimately powerful search and replace function is something of a two-edged sword. What cuts one way may also cut the other, causing as much or more damage than the initial cut.
WARNING:The search and replace functions used improperly or overzealously may make the Registry completely unusable and cause the system to crash. Be extremely careful. One good way to ensure better protection is to use only the prompted replacement. It may save you a lot of time in the long run. Most people have made an error like searching and replacing "won" with "lost," only to find themselves with words like "lostderful." In addition to selecting Prompted for the Replacement criteria, select Match whole words, restricting the type of replacements.
To ensure that the only changes made are the ones you really want, you can choose Prompted in the Replacement Criteria in the General tab. Figure 37.9 shows the location of the choice.
Figure 37.9. Selecting a prompted replacement.
When the search finds a match, you are given a choice to replace the
string, skip
this instance, or abort the process, as shown in Figure 37.10.
Figure 37.10. The search is successful; the replacement is optional.
Choose to replace, and you will be prompted for the replacement string for each match.
Figure 37.11 shows the replacement text dialog box. Notice that you can force it
to all upper- or lowercase also.
Figure 37.11. Replacement text dialog box
An automatic replacement for all found instances of the string is called a Specified Replacement. Enter the data to search for and the replacement string. When you select Search, all instances found will be replaced, without opportunity to choose. Figure 37.12 shows the option to set a Specified replacement.
Figure 37.12. Automatic replacement of string data.
TIP:Whenever you choose to do a Specified replacement, also choose to log the results to a file (at the General tab). If there is a problem, you can at least look back to the file for the locations.
Be sure to make a backup of the Registry before doing a Specified Replacement. There is no undo feature.
WARNING:If you replace all the instances of a data string with another, you cannot undo it. Likewise, it is not smart to reverse the process. Imagine changing every instance of "ABC" with "XYZ." Later you find that you were mistaken, and not every one should have been changed. If you replace every "XYZ" with "ABC," you may make the problem worse. There may have been other instances of "XYZ" that were not a result of the replacement. It could have disastrous results. Back it up!
Registry Search and Replace is an outstanding program to augment your Registry tools. It is a bargain at $20.00, and should be in every troubleshooter's software toolbox. For more information and a live tutorial, visit http://ourworld.compuserve.com/homepages/shoek and run the tutorial there.
© Copyright, Macmillan Computer Publishing. All rights reserved.