|
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:查询注册表一个数值
rem :查询注册表一个数值 "inout_ptr" "in" "in"
rem :参数列表 输出的数值变量名 注册表路径 [注册表数值名,如果空则查询默认值]
( Reg Query "%~2" )>nul 2>nul || (
goto :eof
)
if "" NEQ "%~1" set "%~1="
if "" NEQ "%~3" (
for /f "delims=*" %%a in ( 'Reg Query "%~2" /v "%~3" ' ) do if "" NEQ "%%a" if "" NEQ "%~1" (
set "查询注册表一个数值_临时变量=%%a"
set "查询注册表一个数值_临时变量=!查询注册表一个数值_临时变量: %~3 =!"
for /f "tokens=1,* delims= " %%b in ( "!查询注册表一个数值_临时变量!" ) do set "查询注册表一个数值_输出数值=%%c"
set "%~1=!查询注册表一个数值_输出数值!"
)
goto :eof
)>nul 2>nul
for /f "delims=*" %%a in ( 'Reg Query "%~2" /ve ' ) do if "" NEQ "%%a" if "" NEQ "%~1" (
set "查询注册表一个数值_临时变量=%%a"
set "查询注册表一个数值_临时变量=!查询注册表一个数值_临时变量: %~3 =!"
for /f "tokens=1,* delims= " %%b in ( "!查询注册表一个数值_临时变量!" ) do set "查询注册表一个数值_输出数值=%%c"
set "%~1=!查询注册表一个数值_输出数值!"
)>nul 2>nul
goto :eof
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
|