@echo off

REM ##############################################################################
REM
REM Windows XP Professional SP2 (32-bit) patch script by Doc Rice v1.2
REM This script requires the use of REG.EXE from the Windows NT 4.0 Resource Kit 
REM and the SLEEP.EXE utility.
REM
REM An updated version of REG.EXE utility can be found at:
REM 
REM ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/reg_x86.exe
REM
REM SLEEP.EXE can be found at:
REM
REM http://www2.gol.com/users/trane/programming/programming.html
REM
REM
REM WARNING: This script assumes your Windows XP OS has been installed with 
REM defaults and currently has IE 6 SP-2.
REM
REM Please see http://winpatch.homeip.net for updated information.
REM
REM ##############################################################################


color 1F
title Windows XP SP2 Hotfix Install
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP2\KB811113" > NUL || goto no-sp2
echo Installing patches for Windows XP SP2...
echo --------------------------------------------------------------------------------
echo Patch list updated as of 8/9/2005.
echo.
echo Today is %date%.
echo.
echo.


REM -------------------------------------------------------------

echo.
echo Checking for MS04-041: Vulnerability in WordPad Could Allow Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB885836\Filelist" /s || echo Patching for Q885836... && .\OS\Q885836\WindowsXP-KB885836-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS04-043: Vulnerability in HyperTerminal Could Allow Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB873339\Filelist" /s || echo Patching for Q873339... && .\OS\Q873339\WindowsXP-KB873339-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS04-044: Vulnerabilities in Windows Kernel and LSASS Could Allow Elevation of Privilege
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB885835\Filelist" /s || echo Patching for Q885835... && .\OS\Q885835\WindowsXP-KB885835-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-007: Vulnerability in Windows Could Allow Information Disclosure
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB888302\Filelist" /s || echo Patching for Q888302... && .\OS\Q888302\WindowsXP-KB888302-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-009: Vulnerability in PNG Processing Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB887472\Filelist" /s || echo Patching for Q890261... && .\OS\Q890261\WindowsXP-KB887472-x86-enu.exe /quiet /norestart

echo.
echo Checking for MS05-011: Vulnerability in Server Message Block Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB885250\Filelist" /s || echo Patching for Q885250... && .\OS\Q885250\WindowsXP-KB885250-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-012: Vulnerability in OLE and COM Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB873333\Filelist" /s || echo Patching for Q873333... && .\OS\Q873333\WindowsXP-KB873333-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-013: Vulnerability in the DHTML Editing Component ActiveX Control Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB891781\Filelist" /s || echo Patching for Q891781... && .\OS\Q891781\WindowsXP-KB891781-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-015: Vulnerability in Hyperlink Object Library Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB888113\Filelist" /s || echo Patching for Q888113... && .\OS\Q888113\WindowsXP-KB888113-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-016: Vulnerability in Windows Shell that Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB893086\Filelist" /s || echo Patching for Q893086... && .\OS\Q893086\WindowsXP-KB893086-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-018: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege and Denial of Service
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB890859\Filelist" /s || echo Patching for Q890859... && .\OS\Q890859\WindowsXP-KB890859-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-019: Vulnerabilities in TCP/IP Could Allow Remote Code Execution and Denial of Service
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB893066\Filelist" /s || echo Patching for Q893066... && .\OS\Q893066\WindowsXP-KB893066-v2-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-026: Vulnerability in HTML Help Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB896358\Filelist" /s || echo Patching for Q896358... && .\OS\Q896358\WindowsXP-KB896358-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-027: Vulnerability in Server Message Block Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB896422\Filelist" /s || echo Patching for Q896422... && .\OS\Q896422\WindowsXP-KB896422-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-032: Vulnerability in Microsoft Agent Could Allow Spoofing
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB890046\Filelist" /s || echo Patching for Q890046... && .\OS\Q890046\WindowsXP-KB890046-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-033: Vulnerability in Telnet Client Could Allow Information Disclosure
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB896428\Filelist" /s || echo Patching for Q896428... && .\OS\Q896428\WindowsXP-KB896428-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-036: Vulnerability in Microsoft Color Management Module Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB901214\Filelist" /s || echo Patching for Q901214... && .\OS\Q901214\WindowsXP-KB901214-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-039: Vulnerability in Plug and Play Could Allow Remote Code Execution and Elevation of Privilege
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB899588\Filelist" /s || echo Patching for Q899588... && .\OS\Q899588\WindowsXP-KB899588-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-040: Vulnerability in Telephony Service Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB893756\Filelist" /s || echo Patching for Q893756... && .\OS\Q893756\WindowsXP-KB893756-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-041: Vulnerability in Remote Desktop Protocol Could Allow Denial of Service
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB899591\Filelist" /s || echo Patching for Q899591... && .\OS\Q899591\WindowsXP-KB899591-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-042: Vulnerabilities in Kerberos Could Allow Denial of Service, Information Disclosure, and Spoofing
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB899587\Filelist" /s || echo Patching for Q899587... && .\OS\Q899587\WindowsXP-KB899587-x86-ENU.exe /quiet /norestart

echo.
echo Checking for MS05-043: Vulnerability in Print Spooler Service Could Allow Remote Code Execution
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB896423\Filelist" /s || echo Patching for Q896423... && .\OS\Q896423\WindowsXP-KB896423-x86-ENU.exe /quiet /norestart


:patch-ie6sp1
REM -------------------------------------------------------------
echo.
echo.
echo Patching Internet Explorer 6 SP2
echo --------------------------------------------------------------------------------
echo.

echo.
echo Checking for MS05-038: Cumulative Security Update for Internet Explorer
.\REG\REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB896727\Filelist" /s || echo Patching for Q896727... && .\IE_60\Q896727\WindowsXP-KB896727-x86-ENU.exe /quiet /norestart


REM -------------------------------------------------------------
echo.
echo.
echo Qchaining hotfixes...
echo.

.\Qchain\qchain.exe


REM -------------------------------------------------------------
color
echo.
echo.
echo Initial update process for Windows XP SP2 completed.  Please reboot 
echo for all hotfixes to take effect and verify patch levels afterwards.
echo.

.\SLEEP\sleep.exe 03
goto end


:no-sp2
echo Service Pack 2 is not installed on this system.  Please install
echo SP2 before running this script.
echo.
pause
goto end


:end