Running Parameters of regedit
REGEDIT [/L: system] [/R: user] filename1
REGEDIT [/L: system] [/R: user]/C filename2
REGEDIT [/L: system] [/R: user]/E filename3 [regpath]
/L: system Specifies the location of the SYSTEM. DAT file.
/R: user Specifies the location of the USER. DAT file.
Filename1 Specifies the file (s) to import into the regist
/C filename2 Specifies the file to create the registry from.
/E filename3 Specifies the file to export the registry.
Regpath Specifies the starting registry key to export from.
(Defaults to exporting the entire registry ).
/S (Windows) Silent-no message on completion.
Quick registry operation from Windows Command Line
Everyone familiar with Windows believes that almost everything can be done through the registry. The real problem is how to quickly find the correct registration key.
In most cases, operating the registry means finding a specific sub-key. Occasionally, you may need to modify the name of the key at once (for example, you may need to change the structure ). Then, how can we quickly find the correct sub-key and execute the modification? In addition, if you want to modify the registry of the local machine
Remote machines make the same changes,
What should I do? This article tells you a good tool, Regfind. Regfind can be found from Resource Kit Supplement One of Windows 2000 Server or downloaded from the Internet. Regfind is applicable to various versions of Windows, including Windows 9x series.
Regfind is a command line tool. Execute Regfind without any options. It displays help information. The simplest usage is to execute a search. For example, if you execute Regfind "QQ", Regfind will find all the registration keys containing the string "QQ", as shown in 1.
In addition to searching, Regfind can also execute replacement: simply add the-r option and a replacement string after the command in Figure 1. For example, if your company name is changed from AGroup to BGroup, you only need to execute: regfind "AGroup"-r "BGroup ". Note: If the search string contains spaces or punctuation characters, the string should be enclosed by quotation marks.
To modify a remote machine, add the-m option after the preceding command and specify the UNC (Universal Naming Convention) path of the remote machine. For example: regfind-m \ server03 "AGroup"-r "BGroup ".
Searching the entire registry is undoubtedly a very time-consuming task. To improve efficiency, You can restrict the Regfind search operation to the branch or subkey of a registry. You only need to specify the Registry location to be searched after the-p option. For example, if you want to restrict the search "AGroup" operation to the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft sub-key, replace the AGroup under the sub-key with the BGroup, and execute: regfind "AGroup"-r "BGroup"-p "HKEY_LOCAL_MACHINESOFTWARE \ Microsoft ".
It can be seen from the above description that Regfind is a very convenient tool, but sometimes you still feel that it cannot meet the requirements. First, Regfind does not support wildcards or regular expressions, which are very useful for complex searches. The only option that adds flexibility to search operations is-y. The-y option makes the Regfind search operation case insensitive, that is, if you execute Regfind AGroup-y, the Regfind search results will contain a combination of AGroup, aGroup, and other uppercase and lowercase letters (if the-y option is not available, Regfind is case sensitive by default, but Regfind Command Options are case insensitive, for example, you can use-R or-r at will ).
Second, if you use Regfind to perform the search/replace operation, it will replace all the found strings. You cannot require Regfind to replace only one of them. The remedy is to restrict the search operation to a specific registry branch. Therefore, my suggestion is: first use Regfind to find all matched registration subkeys, and then use Regfind to perform global replacement or manually modify a specific subkey.
Third, if you want to modify numeric data, Regfind does not seem to be the best helper. This is because, many REG_DWORD values to be processed are not 0 or 1, and the chances of occurrence of 0 and 1 in the Registry are too frequent, and it is likely to be replaced by mistake. The only way to solve the problem is to limit the Regfind search range as accurately as possible.
Modify the Registry directly using the command line
1. CMD
Cmd is a program in Windows that is as small as a pigeon or a command line console. There are two channels to enter the program: first, click "start-> Run", enter "cmd" in the displayed edit box, and then click "OK". Second, when Windows is started, press F8 to enter the startup selection menu, move the optical bar or enter a number to the safe mode command line status. The window that appears is a common msdos interface in the win9x system-a dark window. there is even no msdos window endurance: common tool bars are not mounted. I really cannot figure it out. Why does it keep the dos interface that seems to be a Stone Age for the latest operating system? As usual, the habit is as low as typing: cmd /?, Want to see what will be prompted?
I was surprised by the appearance of the warning material: 1. These information is in Chinese. You must know that the original pure dos environment does not directly support Chinese! 2. there are quite detailed help information. 3. although the interface is a command line interface, it can perform operations on many in-depth projects, such as modifying the registry. later, it was proved that cmd can also directly call the graphic interface program and return to the command line interface after the call is completed.
Although Microsoft regards this tool as a new instance of the command interpreter, the method used is no different from the original dos. After opening the command line window, you can find the same system prompt symbol C:/> As dos. The command must be entered after the prompt and press enter to confirm.
The complete syntax is as follows:
CMD [/A |/U] [/Q] [/D] [/E: ON |/E: OFF] [/F: ON |/F: OFF] [/V: ON |/V: OFF]
[[/S] [/C |/K] string]
Meanings of parameters:
CMD: command name, which can be omitted. The following are the parameters or switches used for the command.
/C: Execute the specified command in the string and then terminate the command.
/K executes the specified string command but retains
/S modify string processing after/C or/K (see below)
/Q close response
/D stop executing the AutoRun command from the Registry (see below)
/A converts the output to an internal pipeline or file command to ANSI
/U converts the output to an internal pipeline or file command to Unicode
/T: fg sets the foreground/background COLOR (for details, see COLOR /?)
/E: Enable command extension ON (see below)
/E: OFF stop command extension (see below)
/F: Enable file and directory name completion characters ON (see below)
/F: OFF stop file and directory name completion characters (see below)
/V: ON uses c as the separator to start the extension of delayed environment variables. For example,/V: ON will
Yes! Var! Allowed during execution! Var! Extension variable var. Var syntax
Variable extension during input, which is different from in a FOR loop.
/V: OFF disables delayed environment extension.
Note that if the string contains quotation marks, separate them with the '&' command separator.
. In addition, for compatibility reasons,/X and/E: ON are the same,/Y and
/E: OFF is the same, and/R is the same as/C. Ignore any other Command Options.
If/C or/K is specified, the rest of the command line after the command option will be processed as the command line; in this case, the following logic will be used to process the quotation mark character ("):
1. If all of the following conditions are met, the quotation marks on the command line will be
Reserved:
-The/S command option is not included.
-Two full quotation marks
-There are no special characters between the two quotation marks, and the special characters are the following
One: <> () @ ^ |
-There must be at least one blank character between two quotation marks.
-There must be at least one executable file name between two quotation marks.
2. otherwise, the old method is to check whether the first character is a pair of quotation marks. If yes, remove the start character and delete the last pair of quotation marks on the command line, retain the text after the last quote character. If/D is not specified on the command line, when CMD. EXE starts, it will look for the following REG_SZ/REG_EXPAND_SZ registry variable. If one or both of these variables exist, the two variables are executed first.
HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorAutoRun
And/or
HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorAutoRun
Command extension is enabled by default. You can also use/E: OFF to disable the extension for a specific call. You can enable or disable all invocation extensions of CMD. EXE on the machine and/or the user login session. You need to set one or two REG_DWORD values in the registry using REGEDT32.EXE:
HKEY_LOCAL_MACHINESoftwareMicrosoftCommand ProcessorEnableExtensions
And/or
HKEY_CURRENT_USERSoftwareMicrosoftCommand ProcessorEnableExtensions
To 0x1 or 0x0. User-specific settings have priority over machine settings. Command Line Command Options have priority over registry settings.
The original dos contains so-called internal and external commands. In cmd, the command line extension is introduced. You can directly execute the following Extension Section in the cmd window, you do not need to add cmd before the extension.
Command line extensions include changes to the following commands and/or addition:
DEL or ERASE
COLOR
CD or CHDIR
MD or MKDIR
PROMPT
PUSHD
POPD
SET
SETLOCAL
ENDLOCAL
IF
FOR
CALL
SHIFT
GOTO
START (including changes made to external command calls)
ASSOC
FTYPE
For more information, enter the HELP command name.
Ii. REG
You can use the reg command line provided by Windows XP.
Reg adds, changes, and displays the Registry subitem information and values in the registry key.
To view the command syntax, click the following command:
Reg add
Add a new subitem or item to the Registry.
Syntax
Reg add KeyName [/v EntryName |/ve] [/t DataType] [/s separator] [/d value] [/f]
Parameters
KeyName
Specify the full path of the sub-item. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC.
/V EntryName
Specifies the name of the item to be added to the specified subitem.
/Ve
The entry added to the registry is null.
/T DataType
Data Type of the specified item value. DataType can be of the following types:
REG_SZ
REG_MULTI_SZ
REG_DWORD_BIG_ENDIAN
REG_DWORD
REG_BINARY
REG_DWORD_LITTLE_ENDIAN
REG_LINK
REG_FULL_RESOURCE_DESCRIPTOR
REG_EXPAND_SZ
/S separator
Specifies the characters used to separate multiple data instances. Use this parameter when REG_MULTI_SZ is specified as the data type and multiple items need to be listed. If not specified, the default separator \ is used \.
/D value
Specify the value of the new registry key.
/F
Add a subitem or item directly without asking for information.
/?
Display help at the command prompt.
Note
This operation cannot add Subtrees. This version of Reg does not need to be confirmed when you add a subitem.
The following table lists the return values of the reg add operation. Value description
0 successful
1 failed
Example
The following example illustrates how to use the reg add command:
Reg add \ hklm \ software \ myco/v data/t reg_binary/d fe340ead
Reg add "hkcu \ software \ microsoft \ winmine"/v Name3/t reg_sz/d Anonymous
Reg add "hkcu \ software \ microsoft \ winmine"/v Time3/t reg_dword/d 5
Reg compare
Compares the specified registry subkeys or items.
Syntax
Reg compare KeyName1 KeyName2 [/v EntryName |/ve] {[/oa] | [/od] | [/OS] | [on]} [/s]
Parameters
KeyName
Specify the full path of the sub-item. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC. If you specify a remote computer, you can only use the HKLM and HKU subdirectory trees.
/V EntryName
Compares specific items under a subitem.
/Ve
Only items with no value can be compared.
{[/Oa] | [/od] | [/OS] | [on]}
Specify the display mode of different points and matching points. The default value is/od. Value description
/Oa indicates that all different points and matching points are displayed. By default, only differences are listed.
/Od indicates that only different points are displayed. This is the default operation.
/OS indicates that only matching points are displayed. By default, only differences are listed.
/On specifies that no content is displayed. By default, only differences are listed.
/S Separator
Compare all subitems and items.
/?
Display help at the command prompt.
Note
The following table lists the return values of the reg compare operation. Value description
0 is successful and the result is the same.
1. Comparison failed.
2. The comparison is successful and the difference is found.
Example
The following example shows how to use the reg compare command:
Reg compare "hkcu \ software \ microsoft \ winmine" "hkcu \ software \ microsoft \ winmine"/od/s
Reg copy
Copy a registry key to a specified location on the local or remote computer.
Syntax
Reg copy KeyName1 KeyName2 [/s] [/f]
Parameters
KeyName1
Specifies the full path of the subitem to be copied. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC. If you specify a remote computer, you can only use the HKLM and HKU subdirectory trees.
KeyName2
Specifies the full path of the subitem destination. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC. If you specify a remote computer, you can only use the HKLM and HKU subdirectory trees.
/S
Copy all the sub-items and items under the specified sub-item.
/F
Copy the subitem directly without request confirmation.
/?
Display help at the command prompt.
Note
This version of Reg does not require confirmation when copying subitems.
The following table lists the return values of the reg copy operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg copy command:
Reg copy "hkcu \ software \ microsoft \ winmine" "hkcu \ software \ microsoft \ winminebk"/s/f
Reg copy "hkcu \ software \ microsoft \ winminebk" "hkcu \ software \ microsoft \ winmine"/s
Reg delete
Delete a key or subitem from the Registry
Syntax
Reg delete KeyName [{/v EntryName |/ve |/va}] [/f]
Parameters
KeyName
Specify the full path of the sub-item. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC.
/V EntryName
Delete a specific item under a subitem. If no item is specified, all items and subitems under the subitem are deleted.
/Ve
Only items with null values can be deleted.
/Va
Deletes all items under a specified subitem. This parameter cannot be used to delete a subitem under a specified subitem.
/F
You do not need to request confirmation to delete an existing registry subitem or entry.
/?
Display help at the command prompt.
Note
The following table lists the return values of the reg delete operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg delete command:
Reg delete "hkcu \ software \ microsoft \ winmine"/v Name1
Reg delete "hkcu \ software \ microsoft \ winmine"/v Time1
Reg delete "hkcu \ software \ microsoft \ winmine"/va
Reg export
Create a copy of the specified sub-item, item, and value to the file, so that it can be transmitted to other servers.
Syntax
Reg export KeyName FileName
Parameters
KeyName
Specify the full path of the sub-item. The Export operation can only work on a local computer. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC.
FileName
Specifies the name and path of the file to be exported. The file must have the. reg extension.
/?
Display help at the command prompt.
Note
The following table lists the return values of the reg export operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg export command:
Reg export "hkcu \ software \ microsoft \ winmine" c: \ data \ regbackups \ wmbkup. reg
Reg import
Copy the file that contains the exported registry subkeys, keys, and values to the registry of the local computer.
Syntax
Reg import FileName
Parameters
FileName
Specifies the name and path of the file to be copied to the registry of the local computer. You must use the reg export command to create the file in advance.
/?
Display help at the command prompt.
Note
The following table lists the return values of the reg import operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg import command:
Reg import hkcu \ software \ microsoft \ winmine "c: \ data \ regbackups \ wmbkup. reg
Reg load
Write the saved sub-keys and items back to different sub-keys in the registry. The purpose is to save it to a temporary file, which can be used to answer the registry key or edit the registry key.
Syntax
Reg load KeyName FileName
Parameters
KeyName
Specify the full path of the sub-item. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC.
FileName
Specifies the name and path of the file to be loaded. You must use reg save with the. hiv extension to create the file.
/?
Display help at the command prompt.
Note
The following table lists the return values of the reg load operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg load command:
Reg load "hkcu \ software \ microsoft \ winminebk2" wmbkup. hiv
Reg query
Return the list of items under the subkeys of the Registry and the subkeys of the next layer.
Syntax
Reg query KeyName [{/v EntryName |/ve}] [/s]
Parameters
KeyName
Specify the full path of the sub-item. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC. If you specify a remote computer, you can only use the HKLM and HKU subdirectory trees.
/V EntryName
Returns a specific item and its value. This parameter only returns items directly located in the next layer of the specified subitem. The items in the subitem under the current subitem cannot be found. If EntryName is omitted, all items under the subitem are returned.
/Ve
Only items with null values are returned.
/S
All sub-items and items in each layer are returned. If this parameter is not used, only the subitem and item of the next layer are returned.
/?
Display help at the command prompt.
Note
The following table lists the return values of the reg query operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg query command:
Reg query "hklm \ system \ currentcontrolset \ control \ session manager"/v maxstacktracedepth
Reg query "hkcu \ software \ microsoft \ winmine"/s
Reg restore
Write the saved sub-keys and items back to the Registry.
Syntax
Reg restore KeyName FileName
Parameters
KeyName
Specify the full path of the sub-item. The Restore operation only works on the local computer. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC.
FileName
Specify the name and path of the file that will be written back to the Registry. The file must be created in advance using the reg save operation with the. hiv extension.
/?
Display help at the command prompt.
Note
This operation overwrites the edited registry key. Before editing the registry key, use reg save to save the parent key. If the editing fails, you can use this operation to restore the subitem.
The following table lists the return values of the reg restore operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg restore command:
Reg restore "hkcu \ software \ microsoft \ winmine" wmbkup. hiv
Reg save
Save a copy of the specified subitem, item, and registry value to the specified file.
Syntax
Reg save KeyName FileName
Parameters
KeyName
Specify the full path of the sub-item. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC.
FileName
Specify the name and path of the created file. If no path is specified, the current path is used.
/?
Display help at the command prompt.
Note
The following table lists the return values of the reg save operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg save command:
Reg save "hkcu \ software \ microsoft \ winmine" wmbkup. hiv
Reg unload
Use reg load to delete some of the loaded registries.
Syntax
Reg unload KeyName
Parameters
KeyName
Specify the full path of the sub-item. For remote computers, please include the computer name before the sub-path in. If ComputerName is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, HKCU, HKCR, HKU, and HKCC.
/?
Display help at the command prompt.
Note
The following table lists the return values of the reg unload operation. Value description
0 successful
1 failed
Example
The following example shows how to use the reg unload command:
Reg unload "hkcu \ software \ microsoft \ winminebk2"
Be careful
Improper registry editing may seriously damage your system. Back up any valuable data on the computer before changing the registry.
Be careful
You can directly edit the registry only when you have no choice. The Registry Editor ignores standard security measures to reduce performance, damage the system, and even require users to reinstall Windows. You can use the program security in the control panel or Microsoft Management Console (MMC) to change most registry settings. If you must directly edit the registry, back up it first. For more information, see "Registry Editor help ".
Note
Use Reg to directly edit the registry of a local or remote computer. These changes may cause the computer to be unable to operate and require the operating system to be reinstalled. Therefore, instead of directly editing the registry, use the control panel or Microsoft Management Console (MMC) whenever possible to change the registry.
Some operations can be used to view or configure registry entries for local or remote computers, while others can only configure registry settings for local computers. In addition, remote access to the registry may also limit the parameters used for an operation. Check the syntax of each operation to verify that the operation can be used on a remote computer, and that the parameters can be used in that case.
Make Windows Registry changes take effect quickly
When we modify the Registry, in many cases, only pressing the F5 key to refresh the registry is not enough for the modification to take effect, but we need to restart the computer. In fact, we don't have to restart the machine every time, just run Windows shell program Explorer (the operations in Windows 9x/Me and Windows 2000/XP are different ).
In Windows 9x/Me
Press Ctrl + Alt + Delete, select "Explorer" in the pop-up window, and click "End Task". The "shutdown" menu appears, do not perform any operation. In the displayed window, click "End Task" to refresh the Registry without restarting Windows.
In Windows 2000/XP
Click "Terminate process" in the lower-right corner, and click "yes" in the displayed warning dialog box. Then press "OK ".