@echo off ::ReqQuery.bat ::Keywords: Registry,REG,Remote REM This script will the registry for the specified key. REM The computer name and registry key value will be displayed. REM You can specify a computername as a runtime parameter. REM If you don't specify a name, the script will query REM the local machine. REM If you want to save results run REM RegQueryList.bat > results.txt ::USAGE :: RegQuery.bat [computername] :: If you don't specify a remote computer, the local computer will :: be queried. REM enter the registry path. do not use quotes. Remote systems can query REM either HKLM or HKU set regPath=hklm\software\microsoft\windows NT\currentversion REM Enter the registry key that you want the value of set regKey=CSDVersion if %1$==$ ( set computer=%computername% ) else ( set computer=%1 ) echo Reg Query "\\%computer%\%regpath%" /v %regkey% FOR /F "tokens=*" %%a in ('Reg Query "\\%computer%\%regpath%" /v %regkey% ^| find /i "%regkey%"') do @echo %computer% %%a GOTO :OUT :OUT set regPath= set regKey= set computer= :EOF