:IsRegValue Key Value -- succeeds if Key and Value exists :: -- Key [in] - registry key :: -- Value [in] - registry value, return default value if omitted SETLOCAL if "%~2"=="" (set v=/ve) ELSE set v=/v "%~2" reg query "%~1" %v%>NUL 2>NUL EXIT /b