Quick operation of the registry from the command line (figure) _ Registration Form

Source: Internet
Author: User
Tags naming convention
Everyone familiar with Windows believes that almost anything can be done through the registry, and the real question is how to quickly find the right registration key.

In most cases, manipulating the registry means finding a specific subkey; Occasionally, you may need to modify the name of a key (for example, a structural change might be required). So, how can you quickly find the right subkey and perform the modification? In addition, what if you not only change the local machine registry, but also make the same changes to the remote machine? This article tells you a good tool regfind. Regfind can be found from Windows Server's resource Kit supplement one, or downloaded from the Web. Regfind applies to various versions of Windows, including the Windows 9x family.

Regfind is a command line tool. Executes regfind with no options, and it displays help information. The simplest use is to perform a lookup, such as executing regfind "QQ", and Regfind will find all the registration keys that contain the string "QQ", as shown in figure one.
Figure 1
In addition to simple lookups, regfind can also perform replacements: simply add the-r option and a replacement string after the Tuyi command. For example, suppose your company's name changed from Agroup to Bgroup, and now you want to make the appropriate changes to all the registration information in the registry, just perform the following: Regfind "Agroup"-R "Bgroup". Note that if the search string contains spaces or punctuation, the string should be enclosed in quotation marks.

If you want to make a corresponding change to a remote machine, simply add the-m option to the previous command and specify the UNC (universal naming convention, Universal Naming convention) path for the remote machine, for example: Regfind-m\\server03 "Agroup" -R "Bgroup".

Searching the entire registry is definitely a time-consuming task. To improve efficiency, you can limit the regfind search operation to a branch or subkey of a registry, simply by specifying the registry location to search for after the-p option. For example, suppose you want to restrict the operation of the search "Agroup" to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft subkey and replace the Agroup under that subkey with Bgroup, execute: regfind "Agroup"-R " Bgroup "-P" hkey_local_machinesoftware\microsoft ".

It can be seen from the above instructions, Regfind is a very convenient tool, but Babbitt have flaws, sometimes you will still feel that it can not meet the requirements. First, Regfind does not support wildcard characters or regular expressions--both of which are useful for performing complex searches. The only option that adds flexibility to the search operation is-y. The-y option makes regfind search operations insensitive to case, that is, if you perform regfind agroup-y, Regfind's search results will contain a combination of agroup, agroup, and other letter-case combinations (if you do not have the-y option, Regfind is case sensitive by default, but regfind command options are not case sensitive, for example, you can use the-R or-R at your discretion.

Second, if you perform a search/replace operation with Regfind, it replaces all the found strings, and you cannot ask Regfind to replace only one of the strings. The only way to remedy the strategy is to limit the search operation to a specific registry branch. So my advice is to first use regfind to find all the matching registry subkeys and then use Regfind to perform global substitution or manually modify a particular subkey.

  Third, if you want to modify the numeric data, Regfind doesn't seem to be the best helper. This is because many of the REG_DWORD values to be processed are either 0 or 1, and 0 and 1 have the opportunity to appear in the registry too frequently, and there is a good chance of a false substitution. The only way to solve the problem is to limit the regfind search scope as precisely as possible.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.