The command: "reg" is on Windows 12, 11, 10, .. , MS Server 2025, 2022, 2019, .. available
Here are concise examples of using some
`REG` commands in the Windows Registry:
`QUERY` (Query):
REG QUERY "HKLM\Software\Example"
This command displays the values ??and subkeys for the specified registry key.
`ADD`:
REG ADD "HKCU\Software\Example" /v ValueName /t REG_SZ /d "Data" /f
Here a new value with the name
"WertName" and the data type
`REG_SZ` is added to the registry.
`DELETE`:
REG DELETE "HKLM\Software\Example" /v ValueName /f
This command deletes a specific value under the specified registry key.
`COPY`:
REG COPY "HKLM\Software\Source" "HKCU\Software\Destination" /s /f
Here values ??and subkeys are copied from a source key to a target key.
`SAVE`:
REG SAVE "HKLM\Software\Example" Example.reg
This command saves the specified registry key to a registry file (here
"Example.reg").
`LOAD`:
REG LOAD HKLM\TempHive C:\Path\To\RegFile.reg
Here a temporary registration hive is loaded from a saved registration file.
`UNLOAD`:
REG UNLOAD HKLM\TempHive
This command unloads a previously loaded registry hive.
`RESTORE`:
REG RESTORE HKLM\BackupHive C:\Path\To\Backup.reg
A previously backed up registry hive is restored here.
`COMPARE` (Compare):
REG COMPARE "HKLM\Software\Example" "HKCU\Software\Example" /s
This command compares the structure and values ??of two registry keys.
`EXPORT` (Export):
REG EXPORT "HKLM\Software\Example" C:\Path\To\ExportedFile.reg
Here the specified registry key is exported to a registry file.
`IMPORT`:
REG IMPORT C:\Path\To\ImportedFile.reg
This command imports values ??and subkeys from a registry file into the registry.