Programmatically extract key and value from Windows registry using simple Dos command line statement SNAGHTML3c07b2b

Programmatically extract key and value from Windows registry using simple Dos command line statement

The Windows Registry can be inspected from a Dos (Command Prompt) command. The key and data element I was looking for is:

Key Name: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe

Data Name: Path

SNAGHTML3c07b2b

The OS command we can use to extract the value of this entry:

REG QUERY “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe” /S /v Path

The result from this command looks like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
     Path    REG_SZ    C:\Program Files (x86)\Google\Chrome\Application
End of search: 1 match(es) found.

image