The command: "reg COMPARE /?" is on Windows 12, 11, 10, .. , MS Server 2025, 2022, 2019, .. available
The examples for the command "reg COMPARE /?"
Here are some examples of using this command:
Example 1: Comparing all values ??under one key:
REG COMPARE HKLM\Software\MyCo\MyApp HKLM\Software\MyCo\SaveMyApp
- Compares all values ??under the
"MyApp" key with the values ??of
"SaveMyApp". Only differences are shown.
Example 2: Comparing a specific value among different keys:
REG COMPARE HKLM\Software\MyCo HKLM\Software\MyCo1 /v Version
- Compares the specific value
"Version" under the keys
"MyCo" and
"MyCo1". Only differences are shown.
Example 3: Comparing all child keys and values:
REG COMPARE \\ZODIAC\HKLM\Software\MyCo \\. /s
- Compares all child keys and values ??under
"HKLM\Software\MyCo" on the computer
"ZODIAC" with the same key on the current computer. Only differences are shown.
The output is in the form of symbols at the beginning of each line, where '=' represents matches, '<' represents differences in the first FullKey, and '>' represents differences in the second FullKey.
Note that the
`REG COMPARE` command does not compare registry branches directly, but rather to exported registry files or registry paths in the registry. Therefore, the command can be useful to identify differences between two parts of the registry.
If you want to compare the contents of two registry branches, you could do this manually by exporting the exported registry files of both branches into separate text files and then comparing those text files. Here is a general approach:
Example 4: Manual comparison of registry branches:
-- Export the first registry branch to a file:
REG EXPORT HKLM\Software\RegBranch1 RegBranch1Export.reg
-- Export the second registry branch to a separate file:
REG EXPORT HKLM\Software\RegBranch2 RegBranch2Export.reg
-- Compare the exported files with a text comparison tool of your choice. For example, using the
`FC` command in the command prompt:
FC /W RegBranch1Export.reg RegBranch2Export.reg
Or use a third-party text comparison tool.
The steps above allow you to identify the differences between the exported registry branches. Note that this approach is manual and does not perform automated verification.
If you need a more comprehensive, automated registry comparison tool, you might consider third-party software designed specifically for the task. Such tools can provide a visual representation of the differences and make the comparison process easier.
"reg COMPARE /?" Excerpt from Microsoft Windows Help
Microsoft Windows [Version 10.0.19045.3693]
(c) Copyright 1985-2023 Microsoft Corp.
C:\\WINDOWS>
Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001. All rights reserved
REG COMPARE KeyName1 KeyName2 [/v ValueName | /ve] [Output] [/s]
KeyName [\\Machine\]FullKey
Machine Name of remote machine - omitting defaults to the current machine
Only HKLM and HKU are available on remote machines
FullKey ROOTKEY\SubKey
If FullKey2 is not specified, FullKey2 is the same as FullKey1
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY
ValueName The value name, under the selected Key, to compare
When omitted, all values under the Key are compared
/ve compare the value of empty value name <no name>
/s Compare all subkeys and values
Output [/oa | /od | /os | /on]
When omitted, output only differences
/oa Output all of differences and matches
/od Output only differences
/os Output only matches
/on No output
Return Code:
0 - Succussful, the result compared is identical
1 - Failed
2 - Successful, the result compared is different
Examples:
REG COMPARE HKLM\Software\MyCo\MyApp HKLM\Software\MyCo\SaveMyApp
Compares all values under the key MyApp with SaveMyApp
REG COMPARE HKLM\Software\MyCo HKLM\Software\MyCo1 /v Version
Compares the value Version under the key MyCo and MyCo1
REG COMPARE \\ZODIAC\HKLM\Software\MyCo \\. /s
Compares all subkeys and values under HKLM\Software\MyCo on ZODIAC
with the same key on the current machine
Important information, tips for the "reg COMPARE /?" command
When using the `REG COMPARE` command, there are a few important points to pay attention to:
1: Create Backup: Before using `REG COMPARE`, it is advisable to create a backup of your registry. Although `REG COMPARE` does not directly make changes to the registry, it can still be helpful to have a backup in case problems arise.
2: Check permissions: Make sure you have sufficient permissions to access the registry keys and values ??you want to compare.
3: Understanding symbols in the output: The output of the `REG COMPARE` command contains symbols at the beginning of each line that indicate the comparison between registry entries. Note that '=' represents matches, '<' represents differences in the first registry branch, and '>' represents differences in the second registry branch.
4: Be careful when using `/s`: If you use the `/s` option to compare all child keys and values, make sure you inspect the output carefully. A comprehensive comparison can produce many results.
5: 32-bit vs. 64-bit: Note the `/reg:32` and `/reg:64` options to determine whether the registry key is accessed via the 32-bit or 64 -Bit registration view should be done. Choose the appropriate option based on the architecture of the registry branch you want to compare.
6: Interpretation of results: Understand that `REG COMPARE` only shows differences. Missing results mean that the registry branches are identical. It is recommended to read the command's full documentation for more details.
7: Remote Comparisons: If you are using `REG COMPARE` on a remote computer, ensure that Remote Registry Services is enabled and that you have the necessary permissions to access the remote computer.
8: Validation of results: Carefully review the results of the comparison before drawing conclusions. It is possible that some differences are negligible or due to system-specific differences.
In general, it is important to use the `REG COMPARE` command carefully and with an understanding of its implications, especially when comparing registry entries containing potentially sensitive information.