Advertisement
DavidRuhmann

WinXP Find Registry Key by Value Data

Jun 18th, 2013
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :: Based off of http://superuser.com/a/609174/127811
  2. @echo off
  3. setlocal EnableExtensions
  4. set "RegKey=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
  5. set "Search=EMC Avamar for Windows"
  6.  
  7. for /f "tokens=1* delims=[]" %%A in ('reg query "%RegKey%" /s ^| find /i /n "%Search%"') do (
  8.     set "ValuePos=%%A"
  9.     set "Value=%%B"
  10. )
  11.  
  12. if defined ValuePos for /f "tokens=1* delims=[]" %%A in ('reg query "%RegKey%" /s ^| find /i /n "%RegKey%"') do (
  13.     if %ValuePos% gtr %%A SET "Key=%%B"
  14. )
  15.  
  16. echo(%Key%
  17. echo(%Value%
  18. pause>nul
  19. endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement