windows - Extracting specific registry key from REG QUERY based on search string -


i trying extract key value of registry entry. want key have been trying concatenate using /f, had no luck.

eg: command

reg query hkey_local_machine\software\microsoft\windows\currentversion\uninstall /s /f chrome

returns

hkey_local_machine\software\microsoft\windows\currentversion\uninstall{157f97df-a001-36fb-a90c-55949fa130ca} displayname reg_sz google chrome

end of search: 1 match(es) found.


all want result 157f97df-a001-36fb-a90c-55949fa130ca

how can using /f or other similar methods?

many thanks!!

you can try split lines using {} delimiters

@echo off     setlocal enableextensions disabledelayedexpansion      /f "tokens=2 delims={}" %%a in ('         reg query hkey_local_machine\software\microsoft\windows\currentversion\uninstall /s /f chrome     ') set "value=%%a"      echo %value% 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -