CMD Master
Back to Blog
Arnošt Havelka

Registry Hacks

Master the Windows Registry from the command line.

Start Interactive Lesson
Registry Hacks

The Windows Registry is a hierarchical database that stores configuration settings for the operating system, applications, and hardware. With the REG command, you can query, add, modify, and delete registry keys and values directly from the command line — a critical skill for system administrators and power users.

Try the command

Which REG subcommand would you use to inspect a key?

Build the command
reg
Terminal
C:\Users\Student>reg QUERY HKLM\SOFTWARE
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion (Default) REG_SZ (value not set)

Querying the Registry

The REG QUERY command lets you inspect any registry key. This is especially useful for checking installed software, system configuration, or environment variables.

Terminal
C:\Users\Student>reg QUERY HKCU\Environment

Adding Registry Values

Use REG ADD to create or modify registry values. Always be careful when modifying the registry, as incorrect changes can affect system stability.

Terminal
C:\Users\Student>reg ADD HKCU\Environment /v MyVar /t REG_SZ /d "HelloWorld"

Knowledge Check

1 / 2

Which command reads a registry key's values?

References

These documentation links provide authoritative details for the commands used in this article.

Up Next

Network Recon

Map out the network using standard commands.