@rem Build a Bootable Windows XP disk with Service Pack 3 and all critical post-SP3 hotfixes slipstreamed in @rem Copyright (c) 2003-2008, Ross Smith. All rights reserved. :: ChangeLog: :: Added jun-sep releases @rem $Id$ @if "%debug%" == "" echo off @if not "%debug%" == "" echo on :: the full directory path containing the original Windows XP installation CD files :: do not include trailing backslash set sourcedir=D: set builddir= set hotfixdir= :: options for hotfixes set options=/passive /norestart if exist local.cmd call local.cmd :: the full directory path to copy the CD files, to enable them to be slipstreamed :: do not include trailing backslash :: if left blank, you will be asked to enter it if not "%~2" == "" set builddir=%2 :: the relative directory containing the SP3 and all hotfixes :: do not include trailing backslash :: if left blank, the current directory will be used if not "%~3" == "" set hotfixdir=%3 verify other 2>nul setlocal enableextensions setlocal enabledelayedexpansion if not "%~1" == "" set sourcedir=%1 if not defined hotfixdir set hotfixdir=%cd% if exist "%sourcedir%\WIN51" goto source_ok :get_source echo This script will copy files from a Windows XP installation CD to a directory echo you choose, and download and slipstream Service Pack 3 and all Post-SP3 echo security hotfixes into it. echo. echo Enter the directory containing the Windows XP installation CD files :: echo (If it's the root directory, do not enter a trailing backslash) set REPLY= set /p REPLY=or press [Enter] for '%sourcedir%' or enter Q to quit : if "%reply%" == "" set reply=%sourcedir% if /i "%reply%" == "Q" goto :eof if not exist "%reply%\" ( echo. echo The directory '%reply%' does not exist. echo. goto get_source ) if not exist "%reply%\WIN51" ( echo. echo The directory '%reply%' does not contain a Windows XP installation CD. echo. goto get_source ) set sourcedir=%reply% :source_ok if defined builddir goto builddir_ok set _bs=%sourcedir:~-1% if "%_bs%" == "\" set sourcedir=%sourcedir:~0,-1% if "%builddir%" == "" ( set vol= for /f "usebackq tokens=6" %%a in (`vol %sourcedir%`) do set vol=%%a if "!vol!" == "" set vol=xpsp3_cd set builddir=%cd%\!vol! ) :get_builddir echo. echo Enter the full directory name to copy the Windows XP Installation files to set REPLY= set /p REPLY="or press [Enter] for '%builddir%' or enter Q to quit: " if "%reply%" == "" set reply=%builddir% if /i "%reply%" == "Q" goto :eof set _colon=%reply:~1,1% if not "%_colon%" == ":" ( echo. echo "%_colon%"Please enter an absolute path [e.g., C:\ex] goto get_builddir ) mkdir "%reply%" if not exist "%reply%\" ( echo. echo Unable to create directory '%reply%' goto get_builddir ) set builddir=%reply% :builddir_ok set svcpackdir=%builddir%\i386\svcpack if exist "%hotfixdir%" goto hotfix_ok :get_hotfix echo. echo Enter the directory path to contain Service Pack 3 and the hotfixes 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 if not exist "%builddir%\I386\" ( echo. echo Copying "%sourcedir%" to "%builddir%"... echo. if not exist "%builddir%\*.*" mkdir "%builddir%" xcopy "%sourcedir%\." "%builddir%" /e/r/y if errorlevel 1 ( echo The copy did not complete successfully. goto :eof ) ) 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 *KB950759* >nul 2>nul :: Jun 08: :: MS08-030 – Critical :: Vulnerability in Bluetooth Stack Could Allow Remote Code Execution (951376) :: SP2: replaces none :: SP3: replaces none call :download http://download.microsoft.com/download/a/6/5/a65308a2-7ede-4219-981a-20feb38bfd0e/WindowsXP-KB951376-v2-x86-ENU.exe :: MS08-031 - Critical :: Cumulative Security Update for Internet Explorer (950759) :: SP2: replaces MS08-024 :: SP3: replaces none :: replaced by MS08-45 :: call :download http://download.microsoft.com/download/2/2/5/2255ad65-47ba-44f1-9e88-feba8f019c55/WindowsXP-KB950759-x86-ENU.exe :: MS08-032 - Moderate :: Cumulative Security Update of ActiveX Kill Bits (950760) :: SP2: replaces MS08-023 :: SP3: replaces none call :download http://download.microsoft.com/download/c/6/e/c6e4b3e0-0af6-4ac8-92f7-5f7e8d471fb2/WindowsXP-KB950760-x86-ENU.exe :: MS08-033 – Critical :: Vulnerabilities in DirectX Could Allow Remote Code Execution (951698) :: SP2: replaces MS07-064 :: SP3: replaces none call :download http://download.microsoft.com/download/3/1/5/315c86ba-2910-47f0-9f02-b5616511536d/WindowsXP-KB951698-x86-ENU.exe :: MS08-035 – Important :: Vulnerability in Active Directory Could Allow Denial of Service (953235) :: SP2: replaces MS08-003 :: SP3: replaces none call :download http://download.microsoft.com/download/5/f/a/5fa7006d-023f-496f-9c85-796fb82dfd16/WindowsXP-KB949269-x86-ENU.exe :: MS08-036 – Important :: Vulnerabilities in Pragmatic General Multicast (PGM) Could Allow Denial of Service (950762) :: SP2: replaces MS06-052 :: SP3: replaces none call :download http://download.microsoft.com/download/1/4/3/1438b520-8200-466d-9daf-4de18bd4dc0f/WindowsXP-KB950762-x86-ENU.exe :: Jul 08: :: MS08-037 – Important :: Vulnerabilities in DNS Could Allow Spoofing (953230) :: SP2: replaces MS06-064, MS08-001 :: SP3: replaces none call :download http://download.microsoft.com/download/f/5/f/f5f31962-0215-44e6-be41-02818b4373f3/WindowsXP-KB951748-x86-ENU.exe :: Aug 08: :: MS08-045 - Critical :: Cumulative Security Update for Internet Explorer (953838) :: SP2: replaces MS08-031 :: SP3: replaces MS08-031 call :download http://download.microsoft.com/download/3/9/3/3933471e-a08e-4640-8980-d3d3eb5b3c34/WindowsXP-KB953838-x86-ENU.exe :: MS08-046 – Critical :: Vulnerability in Microsoft Windows Image Color Management System Could Allow Remote Code Execution (952954) :: SP2: replaces none :: SP3: replaces none call :download http://download.microsoft.com/download/a/1/9/a19c9aff-bd94-4fc1-98ff-db432358f902/WindowsXP-KB952954-x86-ENU.exe :: MS08-048 - Important :: Security Update for Outlook Express and Windows Mail (951066) :: SP2: replaces none :: SP3: replaces none call :download http://download.microsoft.com/download/3/a/f/3afd84f3-729c-4f54-9d38-e77c5112ae0d/WindowsXP-KB951066-x86-ENU.exe :: MS08-049 – Important :: Vulnerabilities in Event System Could Allow Remote Code Execution (950974) :: SP2: replaces none :: SP3: replaces none call :download http://download.microsoft.com/download/5/d/d/5dd0ab05-b357-4175-bd93-894903f07579/WindowsXP-KB950974-x86-ENU.exe :: MS08-050 – Important :: Vulnerability in Windows Messenger Could Allow Information Disclosure (955702) :: SP2: replaces none :: SP3: replaces none call :download http://download.microsoft.com/download/4/d/8/4d84fd95-9124-461a-95eb-6b5908b6fe62/WindowsXP-KB946648-x86-ENU.exe :: Ssep 08: :: MS08-052 - Critical :: Vulnerabilities in GDI+ Could Allow Remote Code Execution (954593) :: SP2: replaces none :: SP3: replaces none call :download http://download.microsoft.com/download/7/8/1/78141dc7-3b1d-42f3-9aa2-4dca79ad739b/WindowsXP-KB938464-x86-ENU.exe :: MS08-053 - Critical :: Vulnerability in Windows Media Encoder 9 Could Allow Remote Code Execution (954156) :: SP2: replaces none :: SP3: replaces none call :download http://download.microsoft.com/download/2/b/2/2b252ed6-39fe-423d-a74e-d48c85d24c2a/WindowsMedia9-KB954156-x86-ENU.exe :: MS08-054 - Critical :: Vulnerability in Windows Media Player Could Allow Remote Code Execution (954154) :: SP2: replaces none :: SP3: replaces none call :download http://download.microsoft.com/download/b/6/6/b662a844-9aa2-4b80-8713-27a6c0da16d8/WindowsMedia11-KB954154-x86-ENU.exe if not exist "%builddir%\I386\sp3.cab" ( :: http://support.microsoft.com/kb/936929 : Windows XP Service Pack 3 call :download http://download.microsoft.com/download/d/3/0/d30e32d8-418a-469d-b600-f32ce3edf42d/WindowsXP-KB936929-SP3-x86-ENU.exe set KB936929=!rv! if "!KB936929!" == "" ( echo Unable to determine SP3's filename goto :eof ) if not exist "%hotfixdir%\!KB936929!" ( echo File not found: '%hotfixdir%\!KB936929!' goto :eof ) echo Integrating !KB936929!... ::echo start "%hotfixdir%\!KB936929!" /wait "%hotfixdir%\!KB936929!" /integrate:"%builddir%" %options% start "Integrating !KB936929!..." /wait "%hotfixdir%\!KB936929!" /integrate:"%builddir%" %options% set e=%errorlevel% :: 3010 = reboot required if not "!e!" == "3010" ( if errorlevel 1 ( echo !KB936929! returned error %e% goto :eof ) ) ) for %%a in ("%hotfixdir%"\Windows*.exe) do ( for /f "delims=- tokens=2" %%b in ("%%a") do ( set kb=%%b ) if /i not "!kb!" == "KB936929" ( if not exist "%svcpackdir%\!kb!.cat" ( echo Integrating %%a... ::echo start "%%a" /wait "%%a" /integrate:"%builddir%" %options% start "Integrating %%a..." /wait "%%a" /integrate:"%builddir%" %options% set e=%errorlevel% :: 3010 = reboot required if not "!e!" == "3010" ( if errorlevel 1 ( echo %%a returned error %e% goto :eof ) ) ) ) ) echo. echo The directory '%builddir%' has been successfully updated. 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 cacls "%hotfixdir%\%rv%" /T /E /C /G "%USERNAME%":F goto :eof