I am trying to create a bat file that will search a registry hive and return a key that contains a substring …and doesn’t contain another substring….
I need to search and find certain key names but do not have the full key name …\
is there a way to do this with REG.exe
for %%a in ("HKLM" "HKCU" "HKCR" "HKU" "HKCC") do ( 2>nul reg query %%a /s | find /v " " | find /i "wanted string" | find /v /i "unwanted string" )Remove any unneeded hive roots to taste, or add subkeys
to narrow the search.
Remove /i switches to the find commands for a case sensitive search.