So I guess attaching the file did not work (what a surprise). Here is the file\'s contents. Just paste the lines below the dashed line into a text file and name it slipsteam.bat (or whatever you like).
*watch out for lines that are wrapped because of your browser screen width. Batch file processing is not very forgiving as ive found out.
slipstream.bat -- file begins below next line
--------------------------------------------------------------------------------
@ECHO OFF
REM This batch file will call itself with
REM delayed environment variable expansion enabled
REM which is required for the FOR loop to work.
SETLOCAL
IF \"%1\" == \"\" (GOTO :Syntax)
IF \"%1\" == \"-?\" (GOTO :Syntax)
IF \"%1\" == \"/?\" (GOTO :Syntax)
GOTO :ReqCheck
:Syntax
ECHO;
ECHO Replaces all compressed versions of newer files in the build directory.
ECHO;
ECHO Usage: slipstream.bat [/b path] [/m path] [/x [/q]] [/nolog] [/test]
ECHO;
ECHO Parameters:
ECHO /b \"dir\" - Specifies \"dir\" as the build (i386) directory (defaults to current).
ECHO /m \"dir\" - Specifies \"dir\" as the directory to put replaced files (defaults to build).
ECHO /x - Deletes replaced files (overrides /m).
ECHO /q - No delete prompts.
ECHO /nolog - Supresses file replacement messages.
ECHO /test - Emulation mode. Prints messages instead of replacing files.
ECHO;
ECHO Example: slipstream.bat /b D:CDi386 /m .i386_replaced /nolog /test
GOTO :Finish
:ReqCheck
SET envTest=failed
FOR /L %%X IN (1,1,1) DO (
SET envTest=passed
IF NOT !envTest! == passed (
ECHO --------------------------------------------------
ECHO Enabling delayed environment variable expansion...
ECHO --------------------------------------------------
CMD /V:ON /S /K %~f0 %*
GOTO :Finish
)
)
REM Parse parameters
SET buildDir=
SET quiet=no
SET moveDir=
SET delete=no
SET nolog=no
SET emulate=no
IF \"%1\" == \"/b\" (
SET buildDir=%~f2
IF \"!buildDir:~-1,1!\" == \"\" (SET buildDir=!buildDir:~0,-1!)
SHIFT 1
SHIFT 1
) ELSE (
FOR /F \"usebackq\" %%D IN (`CD`) DO (SET buildDir=%%D)
)
IF \"%1\" == \"/m\" (
SET moveDir=%~f2
IF \"!moveDir:~-1,1!\" == \"\" (SET moveDir=!moveDir:~0,-1!)
SHIFT 1
SHIFT 1
) ELSE (
SET moveDir=%buildDir%
)
IF \"%1\" == \"/x\" (
SET delete=yes
SHIFT 1
)
IF \"%1\" == \"/q\" (
SET quiet=yes
SHIFT 1
)
IF \"%1\" == \"/nolog\" (
SET nolog=yes
SHIFT 1
)
IF \"%1\" == \"/test\" (
SET emulate=yes
SHIFT 1
)
REM Check directories.
IF NOT EXIST \"%buildDir%\" (
ECHO Invalid build directory \"%buildDir%\"
GOTO :Syntax
)
IF NOT EXIST \"%moveDir%\" (
MKDIR \"%moveDir%\"
IF NOT EXIST \"%moveDir%\" (
ECHO Invalid move directory \"%moveDir%\"
GOTO :Syntax
)
)
:Start
ECHO;
ECHO Build directory is: \"%buildDir%\"
IF %delete% == no (
ECHO Replaced files will be moved to: \"%moveDir%\"
) ELSE (
ECHO Replaced files will be deleted.
)
IF %quiet% == yes (ECHO Quiet mode enabled.)
IF %nolog% == yes (ECHO Logging mode disabled.)
IF %emulate% == yes (ECHO Emulation mode enabled.)
ECHO;
PAUSE
REM Find, then move or delete replaced files. This checks all
REM files in the build dir (and sub-dirs) that dont end with
REM an underscore. If a file is found that has the same name
REM except with an underscore as its last char, then it is
REM moved or deleted.
SET file=
SET fileEnd=
SET fileCount=0
SET delSwitch=/P /F
IF %quiet% == yes (SET delSwitch=/F /Q)
FOR /R \"%buildDir%\" %%X IN (*.*) DO (
SET file=%%~fX
SET fileEnd=!file:~-1,1!
IF NOT \"!fileEnd!\" == \"_\" (
SET file=!file:~0,-1!_
IF EXIST \"!file!\" (
IF %delete% == yes (
IF %nolog% == no (ECHO deleting \"!file!\")
IF %emulate% == no (DEL !delSwitch! \"!file!\")
) ELSE (
IF %nolog% == no (ECHO moving \"!file!\" to \"!file:%buildDir%=%moveDir%!\")
IF %emulate% == no (MOVE \"!file!\" \"!file:%buildDir%=%moveDir%!\")
)
SET /A fileCount+=1
)
)
)
ECHO;
ECHO %fileCount% files were found.
:Finish
ENDLOCAL