Windows - Registry

Client

GUI

regedit

Console

reg

Management

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

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

Powered by ComboStrap