Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


August 2002

The Regfind Tool


RSS
Subscribe to Windows IT Pro | See More Registry Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

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.

End of Article



Reader Comments
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.


Al Avery July 29, 2002


You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Confirmed: Battery Life Issues Not Windows 7's Fault

Microsoft on Monday issued a lengthy statement about the recent Windows 7 battery controversy, echoing my assessment from earlier in the day, but backing it up with hard, cold evidence. ...

Battery Life Issues Almost Certainly Not Windows 7's Fault

While Microsoft is still investigating a notebook battery life issue that was supposedly caused by Windows 7, some interesting trends have emerged. ...

Microsoft Warns of Windows Version Expirations

Microsoft warned that this year will see three out-of-date Windows versions slip into retirement. ...


Windows OSs Whitepapers Protecting Microsoft SharePoint

Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Cutting Costs with Client Management

7 Ways To Get More From Your SharePoint Deployment Now

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2010 Penton Media, Inc. Terms of Use | Privacy Statement