User:Jenkins08/Batch

From Valve Developer Community
Jump to: navigation, search
For those of you who use it, or are just learning or searching for something in particular;
Here are alot of handy Batch Scripts that i've written . . .

Backup Creators

These backup creators were written using the WinRAR IDE Warning: Without it the following backup_*.bat scripts will not work.

backup_bsp.bat

@ECHO OFF
TITLE Valve Map Backup Utility [BSP]
SET DIR=MAP_BACKUP_BSP
SET NAME=MAP_BACKUP_BSP
SET RARDIR=C:\Program Files\WinRAR\Rar.exe
SET INC=Include lists
MKDIR %DIR%
ECHO ------------------------
ECHO Valve Map Backup Utility Inclusion Generator [BSP] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
DIR %1 /b /o:n /s | FIND /i ".bsp" > "%DIR%\include.txt"
ECHO %INC% Sucessfully Generated...
ECHO ------------------------
ECHO Valve Map Backup Utility Rar Archiver [BSP] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
"%RARDIR%" a -m5 -r -t -ep1 "%DIR%\MAP_BACKUP_BSP.rar" @"%DIR%\include.txt"
sndrec32 /embedding /play /close "%WINDIR%\Media\tada.wav"
DEL "%DIR%\include.txt"
CLS
ECHO ------------------------
ECHO Valve Map Backup Utility [BSP] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
ECHO Backup Completed at %TIME% - %DATE%
PAUSE
EXIT

backup_vmf.bat

@ECHO OFF
TITLE Valve Map Backup Utility [VMF]
SET DIR=MAP_BACKUP_VMF
SET NAME=MAP_BACKUP_VMF
SET RARDIR=C:\Program Files\WinRAR\Rar.exe
SET INC=Include lists
MKDIR %DIR%
ECHO ------------------------
ECHO Valve Map Backup Utility Inclusion Generator [VMF] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
DIR %1 /b /o:n /s | FIND /i ".vmf" > "%DIR%\include.txt"
ECHO %INC% Sucessfully Generated...
ECHO ------------------------
ECHO Valve Map Backup Utility Rar Archiver [VMF] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
"%RARDIR%" a -m5 -r -t -ep1 "%DIR%\MAP_BACKUP_VMF.rar" @"%DIR%\include.txt"
sndrec32 /embedding /play /close "%WINDIR%\Media\tada.wav"
DEL "%DIR%\include.txt"
CLS
ECHO ------------------------
ECHO Valve Map Backup Utility [VMF] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
ECHO Backup Completed at %TIME% - %DATE%
PAUSE
EXIT

backup_models.bat

@ECHO OFF
TITLE Backup Utility [MODELS]
SET DIR=BACKUP_MODELS
SET NAME=BACKUP_MODELS
SET RARDIR=C:\Program Files\WinRAR\Rar.exe
SET INC=Include lists
MKDIR %DIR%
ECHO ------------------------
ECHO Backup Utility Inclusion Generator [MODELS] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
DIR %1 /b /o:n /s | FIND /i ".mdl" > "%DIR%\include.txt"
DIR %1 /b /o:n /s | FIND /i ".vtx" >> "%DIR%\include.txt"
DIR %1 /b /o:n /s | FIND /i ".phy" >> "%DIR%\include.txt"
DIR %1 /b /o:n /s | FIND /i ".jpg" >> "%DIR%\include.txt"
DIR %1 /b /o:n /s | FIND /i ".vvd" >> "%DIR%\include.txt"
ECHO %INC% Sucessfully Generated...
ECHO ------------------------
ECHO Backup Utility Rar Archiver [MODELS] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
"%RARDIR%" a -m5 -r -t -ep1 "%DIR%\BACKUP_MODELS.rar" @"%DIR%\include.txt"
sndrec32 /embedding /play /close "%WINDIR%\Media\tada.wav"
DEL "%DIR%\include.txt"
ECHO ------------------------
ECHO Backup Utility [MODELS] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
ECHO Backup Completed at %TIME% - %DATE%
PAUSE
EXIT

backup_tga.bat

@ECHO OFF
TITLE Backup Utility [TGA]
SET DIR=BACKUP_TGA
SET NAME=BACKUP_TGA
SET RARDIR=C:\Program Files\WinRAR\Rar.exe
SET INC=Include lists
MKDIR %DIR%
ECHO ------------------------
ECHO Backup Utility Inclusion Generator [TGA] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
DIR %1 /b /o:n /s | FIND /i ".tga" > "%DIR%\include.txt"
ECHO %INC% Sucessfully Generated...
ECHO ------------------------
ECHO Backup Utility Rar Archiver [TGA] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
"%RARDIR%" a -m5 -r -t -ep1 "%DIR%\BACKUP_TGA.rar" @"%DIR%\include.txt"
sndrec32 /embedding /play /close "%WINDIR%\Media\tada.wav"
DEL "%DIR%\include.txt"
ECHO ------------------------
ECHO Backup Utility [TGA] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
ECHO Backup Completed at %TIME% - %DATE%
PAUSE
EXIT

backup_vmt_vtf.bat

@ECHO OFF
TITLE Backup Utility [VTF]
SET DIR=BACKUP_VTF
SET NAME=BACKUP_VTF
SET RARDIR=C:\Program Files\WinRAR\Rar.exe
SET INC=Include lists
MKDIR %DIR%
ECHO ------------------------
ECHO Backup Utility Inclusion Generator [VTF] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
DIR %1 /b /o:n /s | FIND /i ".vtf" > "%DIR%\include.txt"
DIR %1 /b /o:n /s | FIND /i ".vmt" >> "%DIR%\include.txt"
ECHO %INC% Sucessfully Generated...
ECHO ------------------------
ECHO Backup Utility Rar Archiver [VTF] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
"%RARDIR%" a -m5 -r -t -ep1 "%DIR%\BACKUP_VTF.rar" @"%DIR%\include.txt"
sndrec32 /embedding /play /close "%WINDIR%\Media\tada.wav"
DEL "%DIR%\include.txt"
ECHO ------------------------
ECHO Backup Utility [VTF] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
ECHO Backup Completed at %TIME% - %DATE%
PAUSE
EXIT

backup_sounds.bat

@ECHO OFF
TITLE Backup Utility [WAV]
SET DIR=BACKUP_WAV
SET NAME=BACKUP_WAV
SET RARDIR=C:\Program Files\WinRAR\Rar.exe
SET INC=Include lists
MKDIR %DIR%
ECHO ------------------------
ECHO Backup Utility Inclusion Generator [WAV] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
DIR %1 /b /o:n /s | FIND /i ".wav" > "%DIR%\include.txt"
DIR %1 /b /o:n /s | FIND /i ".mp3" >> "%DIR%\include.txt"
ECHO %INC% Sucessfully Generated...
ECHO ------------------------
ECHO Backup Utility Rar Archiver [WAV] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
"%RARDIR%" a -m5 -r -t -ep1 "%DIR%\BACKUP_WAV.rar" @"%DIR%\include.txt"
sndrec32 /embedding /play /close "%WINDIR%\Media\tada.wav"
DEL "%DIR%\include.txt"
ECHO ------------------------
ECHO Backup Utility [WAV] © 2008 jenkins_08. All Rights Reserved.
ECHO ------------------------
ECHO Backup Completed at %TIME% - %DATE%
PAUSE
EXIT

Cleaners

Warning: These can be dangerous if you do not know what you are doing! Nothing here for now. ;)


Compilers

Note:March SDK Beta Update has broken most of the Hammer related batch compilers

Map Compilers

First i'll quickly explain MULTI9 means you can drag up to 9 files onto the batch script and it will compile them sequencially . . .

However, To effectively use my map compiling script you will need to download Interlopers Error Checker (link below)
  • Error Checker
  • Put error_checker.exe into steamapps/User/SourceSDK/Bin NOT the engine folder just where SDKLauncher.exe is.
The script is rather on the long side to accept up to the 9 maps at once,
Hence the "anal" part of the name.

buildmap_anal_final_MULTI9.bat

@ECHO OFF

SET GAME=C:\Program Files\Steam\SteamApps\SourceMods\YourMod
SET MAPDIR=%GAME%\maps

PUSHD %~dp1

REM !!! FIRST !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n1
ECHO Compiling %~n1 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n1.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n1.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n1.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n1.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n1.log for list of errors (if any)
ECHO Check %~n1.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n1.bsp GOTO nocopybsp1
COPY %~n1.bsp "%MAPDIR%"
ECHO %~n1.bsp copied to %MAPDIR%.
ECHO %~n1.bsp copied to %MAPDIR% >> "%~n1.log"
:nocopybsp1

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n1.prt

REM !!! SECOND !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n2
ECHO Compiling %~n2 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n2.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n2.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n2.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n2.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n2.log for list of errors (if any)
ECHO Check %~n2.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n2.bsp GOTO nocopybsp2
COPY %~n2.bsp "%MAPDIR%"
ECHO %~n2.bsp copied to %MAPDIR%.
ECHO %~n2.bsp copied to %MAPDIR% >> "%~n2.log"
:nocopybsp2

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n2.prt

REM !!! THIRD !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n3
ECHO Compiling %~n3 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n3.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n3.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n3.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n3.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n3.log for list of errors (if any)
ECHO Check %~n3.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n3.bsp GOTO nocopybsp3
COPY %~n3.bsp "%MAPDIR%"
ECHO %~n3.bsp copied to %MAPDIR%.
ECHO %~n3.bsp copied to %MAPDIR% >> "%~n3.log"
:nocopybsp3

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n3.prt

REM !!! FOURTH !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n4
ECHO Compiling %~n4 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n4.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n4.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n4.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n4.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n4.log for list of errors (if any)
ECHO Check %~n4.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n4.bsp GOTO nocopybsp4
COPY %~n4.bsp "%MAPDIR%"
ECHO %~n4.bsp copied to %MAPDIR%.
ECHO %~n4.bsp copied to %MAPDIR% >> "%~n4.log"
:nocopybsp4

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n4.prt

REM !!! FIFTH !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n5
ECHO Compiling %~n5 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n5.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n5.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n5.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n5.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n5.log for list of errors (if any)
ECHO Check %~n5.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n5.bsp GOTO nocopybsp5
COPY %~n5.bsp "%MAPDIR%"
ECHO %~n5.bsp copied to %MAPDIR%.
ECHO %~n5.bsp copied to %MAPDIR% >> "%~n5.log"
:nocopybsp5

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n5.prt

REM !!! SIXTH !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n6
ECHO Compiling %~n6 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n6.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n6.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n6.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n6.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n6.log for list of errors (if any)
ECHO Check %~n6.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n6.bsp GOTO nocopybsp6
COPY %~n6.bsp "%MAPDIR%"
ECHO %~n6.bsp copied to %MAPDIR%.
ECHO %~n6.bsp copied to %MAPDIR% >> "%~n6.log"
:nocopybsp6

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n6.prt

REM !!! SEVENTH !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n7
ECHO Compiling %~n7 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n7.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n7.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n7.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n7.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n7.log for list of errors (if any)
ECHO Check %~n7.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n7.bsp GOTO nocopybsp7
COPY %~n7.bsp "%MAPDIR%"
ECHO %~n7.bsp copied to %MAPDIR%.
ECHO %~n7.bsp copied to %MAPDIR% >> "%~n7.log"
:nocopybsp7

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n7.prt

REM !!! EIGHTH !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n8
ECHO Compiling %~n8 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n8.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n8.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n8.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n8.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n8.log for list of errors (if any)
ECHO Check %~n8.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n8.bsp GOTO nocopybsp8
COPY %~n8.bsp "%MAPDIR%"
ECHO %~n8.bsp copied to %MAPDIR%.
ECHO %~n8.bsp copied to %MAPDIR% >> "%~n8.log"
:nocopybsp8

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n8.prt

REM !!! NINTH !!!

ECHO -------------------------------
ECHO ------------------------------- >> "compile_times.log"
ECHO Drag and Drop Compiler v0.2
ECHO Drag and Drop Compiler v0.2 >> "compile_times.log"
ECHO Copyright 2009 Jenkins08
ECHO Copyright 2009 Jenkins08 >> "compile_times.log"
ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"

ECHO Compiling %~n9
ECHO Compiling %~n9 >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vbsp.exe" -game "%GAME%" %~n9.vmf
ECHO Finished VBSP: %TIME% - %DATE%
ECHO Finished VBSP: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vvis.exe" -fast -game "%GAME%" %~n9.vmf
ECHO Finished VVIS: %TIME% - %DATE%
ECHO Finished VVIS: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\orangebox\bin\vrad.exe" -both -game "%GAME%" %~n9.vmf
ECHO Finished VRAD: %TIME% - %DATE%
ECHO Finished VRAD: %TIME% - %DATE% >> "compile_times.log"

"%sourcesdk%\bin\error_checker.exe" "%~dp1\%~n9.log"
ECHO Finished Checking Errors: %TIME% - %DATE%
ECHO Finished Checking Errors: %TIME% - %DATE% >> "compile_times.log"
ECHO Check %~n9.log for list of errors (if any)
ECHO Check %~n9.log for list of errors (if any) >> "compile_times.log"

IF NOT EXIST %~n9.bsp GOTO nocopybsp9
COPY %~n9.bsp "%MAPDIR%"
ECHO %~n9.bsp copied to %MAPDIR%.
ECHO %~n9.bsp copied to %MAPDIR% >> "%~n9.log"
:nocopybsp9

ECHO -.-.-.-.-.-.-.-.-.-.-.-.-
ECHO -.-.-.-.-.-.-.-.-.-.-.-.- >> "compile_times.log"
ECHO.
ECHO Done..
ECHO Done.. >> "compile_times.log"
ECHO Current Time: %TIME% - %DATE%
ECHO Current Time: %TIME% - %DATE% >> "compile_times.log"
ECHO ------------------------------- >> "compile_times.log"

DEL %~n9.prt

POPD

REM !!! DONE !!!

PAUSE
EXIT

That does it for the Map compilers, if you need to use Episodic SDK instead of orangebox, hit Ctrl H in notepad and replace "orangebox" with "ep1" without the quotations :)

Texture Compilers

Tip:You can drag up to 9 files onto these batch scripts and it will compile them sequencially . . .

EP1 Engine

ep1_LightmappedGeneric.bat

@ECHO OFF
"%sourcesdk%\bin\ep1\bin\vtex.exe" -nopause -shader LightmappedGeneric %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

ep1_Sky.bat

@ECHO OFF
"%sourcesdk%\bin\ep1\bin\vtex.exe" -nopause -shader Sky %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

ep1_UnlitGeneric.bat

@ECHO OFF
"%sourcesdk%\bin\ep1\bin\vtex.exe" -nopause -shader UnlitGeneric %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

ep1_VertexLitGeneric.bat

@ECHO OFF
"%sourcesdk%\bin\ep1\bin\vtex.exe" -nopause -shader VertexLitGeneric %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

ep1_Water.bat

@ECHO OFF
"%sourcesdk%\bin\ep1\bin\vtex.exe" -nopause -shader Water %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

Orangebox Engine

orangebox_LightmappedGeneric.bat

@ECHO OFF
"%sourcesdk%\bin\orangebox\bin\vtex.exe" -nopause -shader LightmappedGeneric %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

orangebox_Sky.bat

@ECHO OFF
"%sourcesdk%\bin\orangebox\bin\vtex.exe" -nopause -shader Sky %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

orangebox_UnlitGeneric.bat

@ECHO OFF
"%sourcesdk%\bin\orangebox\bin\vtex.exe" -nopause -shader UnlitGeneric %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

orangebox_VertexLitGeneric.bat

@ECHO OFF
"%sourcesdk%\bin\orangebox\bin\vtex.exe" -nopause -shader VertexLitGeneric %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

orangebox_Water.bat

@ECHO OFF
"%sourcesdk%\bin\orangebox\bin\vtex.exe" -nopause -shader Water %1 %2 %3 %4 %5 %6 %7 %8 %9
REM PAUSE
Note:The PAUSE is commented out to increase workflow

File Management

A few simple file management scripts . . .

More to come in this section

listall_bsp.bat

@ECHO OFF
PUSHD %1
DIR %1 /a-d /o /s /b | FIND /i ".bsp" > "bsp_list.txt"
POPD
start /w notepad "bsp_list.txt" /s
PAUSE

listall_materials.bat

@ECHO OFF
PUSHD %1
DIR %1 /a-d /o /s /b | FIND /i ".vtf" > "mat_list.txt"
DIR %1 /a-d /o /s /b | FIND /i ".vmt" >> "mat_list.txt"
POPD
start /w notepad "mat_list.txt" /s
PAUSE

listall_models.bat

@ECHO OFF
PUSHD %1
DIR %1 /a-d /o:n /s /b | FIND /i ".ani" > "models_list.txt"
DIR %1 /a-d /o:n /s /b | FIND /i ".mdl" >> "models_list.txt"
DIR %1 /a-d /o:n /s /b | FIND /i ".phy" >> "models_list.txt"
DIR %1 /a-d /o:n /s /b | FIND /i ".vtx" >> "models_list.txt"
DIR %1 /a-d /o:n /s /b | FIND /i ".vvd" >> "models_list.txt"
POPD
start /w notepad "models_list.txt" /s
PAUSE

listall_vmf.bat

@ECHO OFF
PUSHD %1
DIR %1 /a-d /o /s /b | FIND /i ".vmf" > "vmf_list.txt"
POPD
start /w notepad "vmf_list.txt" /s
PAUSE

GCF Extraction

MOVED TO User:Jenkins08/Batch/GCF


Launchers

Here are some handy mod launchers for Your Sourcemod :)

launchmod.bat

@ECHO OFF
TITLE %~nx0
ECHO ------------------------------------------
ECHO Mod Launcher Batchfile
ECHO (c) Copyright 2009 Jenkins08
ECHO ------------------------------------------

REM ------------------------------------------
REM You can change the next 3 Lines
SET MOD=%STEAM%\SteamApps\SourceMods\YourModHere
SET APPID=420
SET OPTIONS=-fullscreen

REM ------------------------------------------
REM YOU SHOULDNT NEED TO CHANGE FROM HERE
"%STEAM%\Steam.exe" -gameidlaunch %APPID% -game "%MOD%" %OPTIONS%

EXIT

REM ------------------------------------------
REM Mod Launcher Batchfile
REM (c) Copyright 2009 Jenkins08
REM ------------------------------------------
REM EOF

launchmod_devmode.bat

@ECHO OFF
TITLE %~nx0
ECHO ------------------------------------------
ECHO Mod Launcher Batchfile (DEVMODE)
ECHO (c) Copyright 2009 Jenkins08
ECHO ------------------------------------------

REM ------------------------------------------
REM You can change the next 3 Lines
SET MOD=%STEAM%\SteamApps\SourceMods\YourModHere
SET APPID=420
SET OPTIONS=-fullscreen -toconsole -novid -condebug +sv_cheats 1 +jpeg_quality 100 +developer 2 +exec dev.cfg

REM ------------------------------------------
REM YOU SHOULDNT NEED TO CHANGE FROM HERE
"%STEAM%\Steam.exe" -gameidlaunch %APPID% -dev -game "%MOD%" %OPTIONS%

EXIT

REM ------------------------------------------
REM Mod Launcher Batchfile (DEVMODE)
REM (c) Copyright 2009 Jenkins08
REM ------------------------------------------
REM EOF

launchmod_lowspecs.bat

@ECHO OFF
TITLE %~nx0
ECHO ------------------------------------------
ECHO Mod Launcher Batchfile (LOWSPECS)
ECHO (c) Copyright 2009 Jenkins08
ECHO ------------------------------------------

REM ------------------------------------------
REM You can change the next 3 Lines
SET MOD=%STEAM%\SteamApps\SourceMods\YourModHere
SET APPID=420
SET OPTIONS=-dxlevel 80 -novid -console -fullscreen +mat_picmip 3 +mat_dxlevel 81 +r_dynamic 0 +cl_ejectbrass 0 +sv_robust_explosions 0 +dsp_slow_cpu 1

REM ------------------------------------------
REM YOU SHOULDNT NEED TO CHANGE FROM HERE
"%STEAM%\Steam.exe" -gameidlaunch %APPID% -game "%MOD%" %OPTIONS%

EXIT

REM ------------------------------------------
REM Mod Launcher Batchfile (LOWSPECS)
REM (c) Copyright 2009 Jenkins08
REM ------------------------------------------
REM EOF

launchSDK.bat

@ECHO OFF
TITLE %~nx0
ECHO ------------------------------------------
ECHO SDK Launcher Batchfile
ECHO (c) Copyright 2009 Jenkins08
ECHO ------------------------------------------

REM ------------------------------------------
REM YOU SHOULDNT NEED TO CHANGE THIS FILE AT ALL!!
SET APPID=211

"%STEAM%\Steam.exe" -gameidlaunch %APPID%
REM ------------------------------------------

EXIT

REM ------------------------------------------
REM SDK Launcher Batchfile
REM (c) Copyright 2009 Jenkins08
REM ------------------------------------------
REM EOF

That's all i've got for launchers...

Other/Misc

Here are some miscellaneous scripts that don't fit into the above cats.

build_relists.bat

@ECHO OFF

REM Set the mod direcoty . . .
SET MOD=%STEAM%\SteamApps\SourceMods\ToxisResiduum
ECHO.
ECHO.
ECHO Current maps in maplist.txt:
ECHO.
TYPE maplist.txt
ECHO.
ECHO.
ECHO Are You Sure You Want To Build ReList's? (Process May Take A Long Time with many maps)
ECHO.

PAUSE

REM We want as low as graphics as possible for building relists
SET OPTIONS=-w 640 -sw -console -condebug -nocrashdialog -makereslists -usereslistfile maplist.txt +mat_picmip 2 +r_lod 3 -autoconfig %1

"%STEAM%\Steam.exe" -gameidlaunch 420 -game "%MOD%" %OPTIONS%

EXIT

vice_decode.bat

@ECHO OFF
REM Known ICE Keys;
REM CSS: d7NSuLq2
REM CSS: A5fSXbf7 
REM HL2DM: x9Ke0BY7
REM DODS: Wl0u5b3f
REM TF2: E2NcUkG2

REM Decrypting . . .
"bin\vice.exe" -d -x .txt -k d7NSuLq2 "scripts\weapon_name.ctx"
ECHO Done !
PAUSE

vice_encode.bat

@ECHO OFF
REM Known ICE Keys;
REM CSS: d7NSuLq2
REM CSS: A5fSXbf7 
REM HL2DM: x9Ke0BY7
REM DODS: Wl0u5b3f
REM TF2: E2NcUkG2

REM Encrypting . . .
"bin\vice.exe" -x .ctx -k d7NSuLq2 "scripts\weapon_name.txt"
ECHO Done !
PAUSE




That about wraps up this page.

If you have any questions or comments feel free to leave them on my User_talk:Jenkins08/Batch page
Hope these help you in some way or another,
Regards, Jenkins08 :)