@REM BATCH FILE
@ECHO off
REM ==========================================================================
REM Author: Yee Hsu
REM Date: 5/5/2012
REM
REM Desc: Win32 System Batch file for copying files into another folder.
REM Very handy for automating certain task in Windows.
REM ==========================================================================
REM file and version settings
REM assumes ini file has same name with batch file and contains ...
REM
REM [settings]
REM version=12.0.0.256
REM
SET INIFILE="%~dpn0.ini"
call:welcome %0
call:getvalue %INIFILE% "version" "" VERSION
REM Copy EXEs and DLLs
SET SRC=C:\Work\Projects\output\ETVD
SET DST=C:\Work\ETLauncher\Bin\ET_W_%VERSION%
XCOPY /C /D /Y /I /R /S %SRC%\*.dll %DST%
XCOPY /C /D /Y /I /R /S %SRC%\*.exe %DST%
REM Copy locale files
SET LOC=%DST%\locale
XCOPY /C /D /Y /I /R /S %SRC%\*.?st %LOC%
REM Copy DAT files
SET DAT=C:\Work\Projects\main\CORE\dat
XCOPY /C /D /Y /I /R /S %DAT%\*.xml %DST%
REM Delete unecessary files
DEL /F /Q %SRC%\*.dll
DEL /F /Q %SRC%\*.exe
goto:eof
:welcome
ECHO.
ECHO "[%1] - Specific File Copier"
ECHO.
goto:eof
:getvalue
REM This function reads a value from an INI file and stored it in a variable
REM %1 = name of ini file to search in.
REM %2 = search term to look for
REM %3 = group name (not currently used)
REM %4 = variable to place search result
FOR /F "eol=; eol=[ tokens=1,2* delims==" %%i in ('findstr /b /l /i %~2= %1') DO SET %~4=%%~j
goto:eof