@rem Build a Bootable Windows XP disk with Service Pack 2 and all critical post-SP2 hotfixes slipstreamed in @rem Copyright (c) 2003-2006, Ross Smith. All rights reserved. @rem $Id$ goto start The following are superseeded by RyanVM Update Pack 1.3.1 (http://ryanvm.msfn.org/updatepack.html): WindowsXP-KB885835-x86-ENU.exe WindowsXP-KB873333-x86-ENU.exe WindowsXP-KB883939-x86-ENU.exe WindowsXP-KB884020-x86-enu.exe WindowsXP-KB885250-x86-ENU.exe WindowsXP-KB885836-x86-ENU.exe WindowsXP-KB886185-x86-enu.exe WindowsXP-KB893066-v2-x86-ENU.exe WindowsXP-KB893086-x86-ENU.ex :start @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: :: 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 set builddir=%2 :: 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=%3 :: options for hotfixes set options=/passive /norestart verify other 2>nul setlocal enableextensions setlocal enabledelayedexpansion if not "%1" == "" ( set sourcedir=%1 ) if "%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 echo to a directory to allow the files to be slipstream with Service Pack 2 echo and an available Post-XP2 hotfixes. echo. echo Enter the directory containing the Windows XP installation CD files 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 "%builddir%" == "" ( set vol= for /f "usebackq tokens=6" %%a in (`vol %sourcedir%`) do set vol=%%a if "!vol!" == "" set vol=xpsp2_cd set builddir=%cd%\!vol! ) if exist "%builddir%\" goto builddir_ok :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 mkdir "%reply%" if not exist "%reply%\" ( echo. echo Unable to create directory '%reply%' echo. 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 2 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. 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%' :: November, 2005: http://www.microsoft.com/technet/security/bulletin/ms05-nov.mspx :: http://support.microsoft.com/kb/896424: MS05-053: Vulnerabilities in Graphics Rendering Engine Could Allow Code Execution (896424) (Critical) call :download http://download.microsoft.com/download/1/7/f/17f74fcb-5a29-492e-baf5-503357aeaf2b/WindowsXP-KB896424-x86-ENU.exe :: December, 2005: http://www.microsoft.com/technet/security/bulletin/ms05-dec.mspx :: http://support.microsoft.com/kb/905915: MS05-054: Cumulative Security Update for Internet Explorer (905915) (Critical) :: superceeds 896688 call :download http://download.microsoft.com/download/e/d/8/ed8854bf-522b-42e0-8f40-dc0335b7cf46/WindowsXP-KB905915-x86-ENU.exe :: January, 2006: http://www.microsoft.com/technet/security/bulletin/ms06-jan.mspx :: http://support.microsoft.com/kb/912919: MS06-001: Vulnerability in Graphics Rendering Engine Could Allow Remote Code Execution (912919) (Critical) call :download http://download.microsoft.com/download/e/f/5/ef594826-fca1-492e-9981-22e0f579e02e/WindowsXP-KB912919-x86-ENU.exe del /y WindowsXP-KB896688-x86-ENU.exe if not exist "%builddir%\win51ip.sp2" ( :: http://support.microsoft.com/kb/835935 : Windows XP Service Pack 2 call :download http://download.microsoft.com/download/1/6/5/165b076b-aaa9-443d-84f0-73cf11fdcdf8/WindowsXP-KB835935-SP2-ENU.exe set KB835935=!rv! if "!KB835935!" == "" ( echo Unable to determine SP2's filename goto :eof ) if not exist "%hotfixdir%\!KB835935!" ( echo File not found: '%hotfixdir%\!KB835935!' goto :eof ) echo Integrating !KB835935!... ::echo start "%hotfixdir%\!KB835935!" /wait "%hotfixdir%\!KB835935!" /integrate:"%builddir%" %options% start "%hotfixdir%\!KB835935!" /wait "%hotfixdir%\!KB835935!" /integrate:"%builddir%" %options% set e=%errorlevel% if errorlevel 1 ( echo !KB835935! returned error %e% goto :eof ) ) :: can't use quotes :( for %%a in (%hotfixdir%\WindowsXP-KB*.exe) do ( for /f "delims=- tokens=2" %%b in ("%%a") do ( set kb=%%b ) if /i not "!kb!" == "KB835935" ( if not exist %svcpackdir%\!kb!.cat ( echo Integrating %%a... ::echo start "%%a" /wait "%%a" /integrate:"%builddir%" %options% start "%%a" /wait "%%a" /integrate:"%builddir%" %options% set e=%errorlevel% 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 start /D"%hotfixdir%" /wait /b %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