Windows - Registry

> Operating System - Kernel (Windows, Unix, Linux) > Windows (and utilities)

1 - Client

1.1 - GUI

regedit

1.2 - Console

reg

2 - Management

2.1 - Query

Example on how to query the below key that has 5 value:

set KEY_NAME="HKEY_CURRENT_USER\Software\Microsoft\Command Processor"
REG QUERY %KEY_NAME%
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
    CompletionChar    REG_DWORD    0x9
    DefaultColor    REG_DWORD    0x0
    EnableExtensions    REG_DWORD    0x1
    PathCompletionChar    REG_DWORD    0x9
REG QUERY %KEY_NAME% /v DefaultColor
DefaultColor    REG_DWORD    0x0
Advertising

2.2 - Value is set ?

set KEY_NAME=Computer\HKEY_CURRENT_USER\Console
set VALUE_NAME=VirtualTerminalLevel
FOR /F "usebackq skip=4 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
    set VALUE_VALUE=%%C
)
if not defined VALUE_VALUE (
  @echo %KEY_NAME%\%VALUE_NAME% not found.
)