Вроде сделал. Прошу проверить верность скриптов и подсказать, как их объединить в один
Код:
@ECHO OFF
SetLocal enabledelayedexpansion
SET UNISTALL=HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall
FOR /f "tokens=7 delims=\" %%a IN ('reg query "%UNISTALL%"') DO (
set "upd=%%a"
if /i "!upd:~0,2!"=="KB" (
set "up1=!upd:~0,9!"
if /i "!up1:~-1!"=="-" set "up1=!up1:~0,8!"
if /i "!up1:~-1!"=="_" set "up1=!up1:~0,8!"
echo !up1!
)
)
pause
Код:
@ECHO OFF
SetLocal enabledelayedexpansion
SET UNISTALL=HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall
FOR /f "tokens=7 delims=\" %%a IN ('reg query "%UNISTALL%"') DO (
FOR /f "tokens=1,2*" %%b IN ('reg query "%UNISTALL%\%%a" ^| FIND /I "HelpLink"') DO (
set "tt=%%d"
if /i "!tt:~7,21!"=="support.microsoft.com" (
set "up2=!tt:~-9!"
if /i "!up2:~0,2!"=="d=" set "up2=KB!up2:~2!"
if /i "!up2:~0,1!"=="=" set "up2=KB!up2:~1!"
if /i "!up2:~0,3!"=="id=" set "up2=KB!up2:~3!"
if /i "!up2:~0,3!"=="kb/" set "up2=KB!up2:~3!"
if /i "!up2:~6,2!"=="-v" set "up2=KB!up2:~0,-3!"
if /i "!up2:~0,4!"=="KBKB" set "up2=!up2:~2!"
echo !up2!
)
)
)
pause