Description: |
call:GetRegValue Key Value Data Type |
Script: |
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22.
|
:GetRegValue Key Value Data Type -- returns a registry value
:: -- Key [in] - registry key
:: -- Value [in] - registry value
:: -- Data [out] - return variable for Data
:: -- Type [out] - return variable for Type, i.e.: REG_SZ, REG_MULTI_SZ, REG_DWORD_BIG_ENDIAN, REG_DWORD, REG_BINARY, REG_DWORD_LITTLE_ENDIAN, REG_NONE, REG_EXPAND_SZ
:$created 20060101 :$changed 20080219 :$categories Registry
:$source https://www.dostips.com
SETLOCAL ENABLEDELAYEDEXPANSION
set Key=%~1
set Val=%~2
if "%Val%"=="" (set v=/ve) ELSE set v=/v "%Val%"
set Data=
set Type=
for /f "tokens=2,* delims= " %%a in ('reg query "%Key%" %v%^|findstr /b "....%match%"') do (
set Type=%%a
set Data=%%b
)
( ENDLOCAL & REM RETURN VALUES
IF "%~3" NEQ "" (SET %~3=%Data%) ELSE echo.%Data%
IF "%~4" NEQ "" (SET %~4=%Type%)
)
EXIT /b
|
|