Export a registry key subtree to a .reg file: reg export HKCU\Software\MyApp C:\Backup\MyApp.reg
Import a .reg file to restore or apply settings: reg import C:\Backup\MyApp.reg
Query a specific value from the command line: reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion /v ProgramFilesDir
Add a registry value: reg add HKCU\Software\MyApp /v Theme /t REG_SZ /d Dark /f
Delete a value: reg delete HKCU\Software\MyApp /v Theme /f
Known gotchas
reg import merges the .reg file into the registry; existing values are overwritten but keys present in the registry but absent from the file are left intact — it is not a full restore.
The /f flag suppresses confirmation prompts in both add and delete operations; omit it in interactive scripts where accidental overwrites are a concern.
Exporting and importing HKLM keys requires an elevated command prompt; HKCU operations do not require elevation for the current user.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp