@echo off cls SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION ::Strings SET SRCPATH=%~d0 SET DESTPATH=%~dp0 :: operating system ws03|WinXP SET OS=ws03 :: operating system Service Pack version SP1|SP2 SET SP=SP1 :: operating system language en|fr SET LNG=en :: operating system installation image path WIN51Ix.SPx A=standard|B=Web|P=Professional SET TYPE=A SET SOURCE=%~dp0WIN51I%TYPE%.%SP% ::-Here above ^^^^^^^^ put path to i386 directory SET DEBUG=TEMP\DEBUG.TXT IF EXIST %DEBUG% DEL %DEBUG% SET TXTSETUP=TEMP\TXTSETUP.TXT IF EXIST %TXTSETUP% DEL %TXTSETUP% ECHO/Starting HF Slipstreaming Phase 2 call :P2 call :end goto :eof :P2 Set infname= SET SectionHeader= FOR /F "TOKENS=*" %%A IN ( 'dir /B %source%\i386\svcpack\HFINT.dat' ) DO (( set infname=%source%\i386\svcpack\%%A) & ( set SectionHeader=FixesInstalled) & ( call :Fixesinstalled )) goto :eof :FixesInstalled FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /B /L /I /C:"[%SectionHeader%]" /N %infname%' ) DO (set sourcebegin=%%i) IF not defined sourcebegin GOTO :EOF FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /B /L /I /C:"[" /N %infname% ^| FIND /V ":;"' ) DO ( IF %%i GTR %sourcebegin% ( set sourceend=%%i GOTO :exitloop) ) :exitloop FOR /F "tokens=1,2 delims=:= " %%i IN ( 'findstr /L /I /V /C:"=" /N %infname%' ) DO (IF %%i GTR %sourcebegin% (IF %%i LSS %sourceend% (IF /I NOT %infname%==%%j set sourcefile=%%j) & (Call :KBNUMBER %%j)) ) goto :eof :KBnumber SET SectionHeader=%1 echo.[%SectionHeader%] >>%debug% FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /B /L /I /C:"[%SectionHeader%]" /N %infname%' ) DO (set sourcebegin=%%i) IF not defined sourcebegin GOTO :EOF :// need to fix the end line number because pattern at the beginning of last line in infname file isn't a "[" FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /N /V /I /C:"$" /N %infname%' ) DO (set sourceend=%%i) set /a sourceend=%sourceend%+1 FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /B /L /I /C:"[" /N %infname% ^| FIND /V ":;"' ) DO ( IF %%i GTR %sourcebegin% ( set sourceend=%%i GOTO :exitloop) ) :exitloop FOR /F "tokens=1,2 delims=:= " %%i IN ( 'findstr /L /I /V /C:"=" /N %infname%' ) DO (IF %%i GTR %sourcebegin% (IF %%i LSS %sourceend% (IF /I NOT %infname%==%%j set sourcefile=%%j) & (call :filenaming %%j)) ) goto :eof :filenaming set filename=%~1 :/debug/echo.~~~filenaming~~~%filename% for /f "tokens=1-7 delims=," %%a in ('type %source%\i386\txtsetup.sif ^| findstr /b /i /c:"%filename%" ^|find " = 1,"') do (call :Parse "%%~a" "%%~b") :found (if "%compvalue%"=="_x" goto :notcompressed rem echo.~~~makecab~~~%FILENAME% >>%debug% ) set compvalue= :// build log file for new binary files to add to txtsetup.sif if "%string%" NEQ "%filename%" ( echo.%FILENAME%>>%txtsetup%)&(IF EXIST %source%\i386\%FILENAME% move %source%\i386\%FILENAME% Temp\newbin\)&(echo.~~~move~~~%FILENAME% >>%debug%)&(goto :eof) :// if exist added 16:16 21/05/2006 to avoid move error for binary in more than one HF already moved- not checked set string= :: updated binary should be compressed, according to txtsetup.sif call :UpperCase %filename% goto :eof :notcompressed :: txtsetup.sif: the _x means the file is not compressed on the cd. :: binary left untouched echo.~~~notcompressed~~~%FILENAME% >>%debug% IF EXIST %source%\i386\%1 copy %source%\i386\%1 Temp\bin_notc\ goto :eof :Parse Set string=%~1 Set compvalue=%~2 :/not used/IF "%STRING:~-1%"=="1" () echo.~~~txtsetup.sif~~~%string% %compvalue% >>%debug% ://://remove 4 end chars space equal sign space 1 digit Set string=%STRING:~0,-4% ://://remove trailing spaces at end SET string=%string: =% goto :eof :UpperCase ::rem FILECASE /U %source%\i386\%1 echo. %1 has been compressed MAKECAB /D CompressionMemory=21 /D CompressionType=LZX /L %source%\i386 %source%\i386\%1 >NUL IF EXIST %source%\i386\%1 move %source%\i386\%1 Temp\bin_notc\ echo.~~~makecab~~~%FILENAME% >>%debug% goto :eof :END ECHO/End of HF Slipstreaming Phase 2 PING 1.1.1.1 -n 1 -w 5000 2>NUL | FIND "TTL=" >NUL goto :eof :Syntax ECHO HFINT.CMD, Version 16:16 21/05/2006 for Windows 2003 Server ECHO parse SVCPACK\HFINT.DAT to compress updated binaries after hotfixes integration ECHO use TXTSETUP.SIF to check if binary should be compressed or left untouched ECHO. ECHO Usage: HFINT.CMD ECHO. ECHO output debug.txt logfile and txtsetup.txt for txtsetup.sif alteration ECHO. ECHO Some parts written by Bilou_Gateux ECHO using subroutine from hp38guser Driver Compressor tool ECHO http://www.msfn.org/board/index.php?s=&showtopic=35869&view=findpost&p=246928 :EOF