@echo off rem rem batch file to make backup and distributable rem rem makedist projectDirPath exeName rem if not exist "%~1\" ( echo. echo Source folder "%~1" doesn't exist. goto :end ) setlocal set fname="%~s1\Release\%~2" if not exist %fname% ( echo. echo Project "%~1" doesn't seem to be built. goto :end ) for /f "usebackq" %%i in (`getfver %fname%`) do set fver=%%i if exist "%~1 %fver%" ( echo. echo Backup folder "%~1 %fver%" already exists. goto :end ) if not exist "%~dp0makedist.exc" ( echo>"%~dp0makedist.exc" .sbr echo>>"%~dp0makedist.exc" .pch echo>>"%~dp0makedist.exc" .obj echo>>"%~dp0makedist.exc" .res echo>>"%~dp0makedist.exc" .idb echo>>"%~dp0makedist.exc" .aps echo>>"%~dp0makedist.exc" .ncb echo>>"%~dp0makedist.exc" .opt echo>>"%~dp0makedist.exc" .plg echo>>"%~dp0makedist.exc" .bsc echo>>"%~dp0makedist.exc" .ilk ) echo copying backup "%~1 %fver%"... xcopy "%~1" "%~1 %fver%" /I /S /Q /EXCLUDE:makedist.exc echo copying source dist "E:\Inetpub\ftproot\%~n1\"... del /Q "E:\Inetpub\ftproot\%~n1\" xcopy "%~1 %fver%" "E:\Inetpub\ftproot\%~n1" /I /Q echo copying executable dist "E:\Inetpub\ftproot\%~2%"... xcopy %fname% "E:\Inetpub\ftproot\" /Q /Y :end