Back to Blog
Arnošt Havelka

Registry Hacks

Master the Windows Registry from the command line.

Start Interactive Lesson
Registry Hacks

Windows 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.

Usage:REG
QUERY
HKLM\...
QUERY
Reads and displays registry keys and values.
ADD
Adds a new registry key or value.
DELETE
Deletes a registry key or value.
EXPORT
Exports registry keys to a .reg file.

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.

Command Prompt
C:\Users\User>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.

Command Prompt
C:\Users\User>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 Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.

Up Next

WMIC Mastery

Query and manage Windows systems with WMIC.