@rem Apply Microsoft XML Core Services hotfixes @rem Copyright (c) 2003-2007, Ross Smith. All rights reserved. @rem $Id$ @if "%debug%" == "" echo off @if not "%debug%" == "" echo on :: the relative directory containing the SP2 and all hotfixes :: do not include trailing backslash :: if left blank, the current directory will be used set hotfixdir=. :: options for hotfixes set options=/passive /norestart if not "%1" == "" ( set hotfixdir=%1 ) verify other 2>nul setlocal enableextensions setlocal enabledelayedexpansion if exist "%hotfixdir%" goto hotfix_ok :get_hotfix echo. echo Enter the directory path to contain Service Pack 2 and the hotfixes set REPLY= set /p REPLY=or press [Enter] for '%hotfixdir%' or enter Q to quit : if /i "%reply%" == "Q" goto :eof if not exist "%reply%\" ( echo. echo The directory '%reply%' does not exist echo. goto get_hotfix ) set hotfixdir=%reply% :hotfix_ok echo Please save all files in the directory '%hotfixdir%' if not "%DOWNLOADER%" == "" goto start_downloads wget --version >nul 2>nul if not errorlevel 9009 ( set DOWNLOADER=wget -nd -N goto start_downloads ) curl --version >nul 2>nul if not errorlevel 9009 ( set DOWNLOADER=curl -k -L -O -R goto start_downloads ) set DOWNLOADER=start /D"%hotfixdir%" /wait /b :start_downloads del /f msxml6-KB925673-enu-x86.exe >nul 2>nul del /f msxml4-KB927978-enu.exe del /f msxml6-KB927977-enu-x86.exe :: http://support.microsoft.com/kb/925673: MS06-061: Vulnerabilities in Microsoft XML Core Services 6.0 RTM Could Allow Remote Code Execution (Critical) :: replaced by MS07-042/kb936227: :: call :download http://download.microsoft.com/download/6/2/1/621b68f5-d9fb-47a2-902b-1baa27a65d9f/msxml6-KB925673-enu-x86.exe :: http://support.microsoft.com/kb/927978: MS06-071: Security update for Microsoft XML Core Services 4.0 (Critical) :: replaced by MS07-042/kb936227: :: call :download http://download.microsoft.com/download/e/2/e/e2e92e52-210b-4774-8cd9-3a7a0130141d/msxml4-KB927978-enu.exe :: http://support.microsoft.com/kb/927977: MS06-071: Vulnerabilities in Microsoft XML Core Services 6.0 Could Allow Remote Code Execution (Critical) :: replaced by MS07-042/kb936227: :: call :download http://download.microsoft.com/download/4/8/5/485407a8-bb8e-436e-9142-822e404c2cf5/msxml6-KB927977-enu-x86.exe ;: Aug 07: :: http://support.microsoft.com/kb/936021: MS07-042: Security update for Microsoft XML Core Services 3.0 (936227) (Critical) call :download http://download.microsoft.com/download/e/2/6/e2666a8f-c584-4b0c-9647-655d15f01c23/WindowsXP-KB936021-x86-ENU.exe :: http://support.microsoft.com/kb/936181: MS07-042: Security Update for Microsoft XML Core Services 4.0 Service Pack 2 (936227) (Critical) call :download http://download.microsoft.com/download/9/4/2/9422e6b6-08ee-49cb-9f05-6c6ee755389e/msxml4-KB936181-enu.exe :: http://support.microsoft.com/kb/933579: MS07-042: Security Update for Microsoft XML Core Services 6.0 and Service Pack 1 (936227) (Critical) call :download http://download.microsoft.com/download/1/9/c/19cb7ce9-0ff3-4c66-9923-dfd368fd9cd3/msxml6-KB933579-enu-x86.exe set fixes_applied= set XPSP2_REG=%temp%\xpsp2.reg del /f "%XPSP2_REG%" >nul 2>nul regedit /e "%XPSP2_REG%" "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3" set e=%errorlevel% if not exist "%XPSP2_REG%" ( echo Can't export "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3" to echo "%XPSP2_REG%" echo regedit returned error %e% goto :eof ) for %%a in ("%hotfixdir%"\msxml*.exe) do ( for /f "delims=- tokens=2" %%b in ("%%a") do ( set kb=%%b ) find "!kb!" "%XPSP2_REG%" >NUL 2>NUL if errorlevel 1 ( echo Integrating %%a... start "Integrating %%a..." /wait "%hotfixdir%\%%a" %options% /log "%temp%\%%~nA.log" set e=%errorlevel% if errorlevel 1 ( echo %%a returned error %e% goto :eof ) set fixes_applied=!fixes_applied! !kb! ) ) del /f "%XPSP2_REG%" echo. if "%fixes_applied%" == "" ( echo All fixes have already been applied to %SystemRoot% ) else ( echo The following fixes have been applied to %SystemRoot%: echo %fixes_applied% set /p REPLY=Do you want to reboot now [Y,N] ? if /i "%reply%" == "y" ( shutdown -r -t 20 -c "Applied hotfixes %fixes_applied%" ) ) echo. goto :eof :download for /f "delims=/ tokens=8" %%a in ("%1") do set exe=%%a set rv=%exe% if "%rv%" == "" ( echo Unable to parse the filename from "%1" goto :eof ) if exist "%hotfixdir%\%rv%" goto :eof %DOWNLOADER% %1 :loop cls echo.|time|find "current" echo Waiting for "%hotfixdir%\%rv%" to appear echo or press [Ctrl]-[Break] to abort... ping -w 1000 -n 2 127.0.0.1 >nul 2>nul if not exist "%hotfixdir%\%rv%" goto :loop goto :eof