Сделал как-то так:
Код:
@ECHO OFF
setlocal enabledelayedexpansion
SET UNISTALL=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products
FOR /f "tokens=10 delims=\" %%a IN ('reg query "%UNISTALL%" ^|FIND /I "00004109"') DO (
FOR /f "tokens=12 delims=\" %%b IN ('reg query "%UNISTALL%\%%a\Patches"') DO (
FOR /f "tokens=1-3" %%c IN ('reg query "%UNISTALL%\%%a\Patches\%%b" 2^>nul ^| FIND /I "MoreInfoURL"') DO (
FOR /f "tokens=4 delims=/" %%g IN ("%%e") DO (
Set Update=!Update!:%%g:
Set %%g=UpdateSorting
))))
For /F "tokens=1 delims==" %%P In ('Set^|Sort^|Find "UpdateSorting"') Do Echo KB%%P>>Inst_Update.txt