Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

July 22, 2002 12:00 AM

The Regfind Tool

Windows IT Pro
InstantDoc ID #25654
Rating: (0)
This search-and-replace registry tool is helpful but flawed

Every Windows geek knows that you can use the registry to fix just about anything. The trick is finding the particular registry subkey that you need. On most occasions, you need to find the registry subkey that corresponds to a fix you need to make. Other times, you need to change the name of the actual subkey (e.g., because of an organizational change). But how do you find these subkeys? And what if you need to edit not just your local machine's registry but also remote machines' registries? The answer to these questions is Regfind, which you can find in the Microsoft Windows 2000 Server Resource Kit Supplement One. (The tool also works with Windows 9x registries.)

To use Regfind in its simplest form, you feed the utility a string of characters to search for. For example, the command

regfind "acme"

searches the registry for any keys containing the string acme. You can also use Regfind to replace one string with another: Simply add the -r option and the new string. For example, suppose your company recently changed its name from Acme Ltd to Apex Industries and you want all the product-registration information in the registry to reflect that change. You would type

regfind "Acme Ltd"
  -r "Apex Industries"

When a space or punctuation mark appears in a search string, you must enclose the string in quotation marks.

If you needed to make the same change on a remote machine's registry, you would add the -m option followed by the server's Universal Naming Convention (UNC) path, as in

regfind -m \\server03 "Acme Ltd" -r "Apex Industries"

To speed up Regfind, you can limit its search to a particular registry hive or subkey. Use the -p option to specify the registry location you want to search. For example, suppose you want to narrow your search for Acme Ltd to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft subkey. To restrict Regfind's search-and-replace efforts to subkeys within that subkey, you would type

regfind "Acme Ltd"
  -r "Apex Industries"
  -p "HKEY_LOCAL_MACHINESOFTWARE\Microsoft"

Regfind is a helpful tool, but I've discovered a few drawbacks. First, Regfind doesn't seem to support wildcards or UNIX-style regular expressions. The only flexibility that you can build into Regfind is through the -y option, which makes Regfind case insensitive. For example, the command

regfind acme -y

would match acme, Acme, ACME, and all other uppercase-and-lowercase combinations. Oddly, Regfind's options are case insensitive—for example, you can type either -R or -r.

Second, when you use Regfind in a search-and-replace operation, the tool replaces all instances of the string. I haven't found a way to use Regfind to change only one instance of a string, except by using the marginally helpful method of restricting the search to a specific hive. My suggestion—and the Regfind Help suggestion—is to first use Regfind to find the item you're looking for, then either go ahead with the global replace or manually change the specific items you want to replace.

Third, if you need to modify numerical data (e.g., change a timeout parameter from 15 to 30), Regfind isn't the best tool for the task. If you were to instruct Regfind to change 15 to 30 in the registry, the tool would find every registry subkey with a 15 value and change that value to 30. Of course, you can restrict searches to a particular key's subkeys, but even this workaround's parameters are too broad. Most REG_DWORD values that you would want to manipulate contain values of 1 or 0, and more than one REG_DWORD value in a given key or subkey would probably be 1 or 0. Using Regfind to change one value would change them all.

Related Content:

ARTICLE TOOLS

Comments
  • Al Avery
    10 years ago
    Jul 29, 2002

    A registry editor tool that overcomes the shortcomings mentioned in Mark's is RegCrawler (http://www.dcsoft.com/products/regeditx/regcrawler.htm) from DC Software Design (http://wwwdcsoft.com/). I have found it to be a pwoerful and very flexible search and editing tool. It is a shareware product well worth the $29.95.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.