Last active
December 30, 2015 07:19
-
-
Save octavian-nita/7795509 to your computer and use it in GitHub Desktop.
Batchfile template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if "%DEBUG%"=="" @echo off | |
setlocal enabledelayedexpansion | |
:: ===== | |
:: Command line arguments check: | |
:: ===== | |
if [%1]==[] ( | |
echo Usage: %0 arg-1 [arg-2] ... | |
exit /b 1 | |
) | |
:: Setting / modifying variables in loops -- example (TODO: remove this and place it into a gist): | |
:: | |
:: set CLASSPATH=WEB-INF\classes | |
:: for /f %%F in ('dir /b %LIBDIR%') do ( | |
:: set CLASSPATH=!CLASSPATH!;%LIBDIR%\%%F | |
:: ) | |
:: Delete myself :) ... | |
:: start /b "" cmd /c del "%~f0"&exit /b | |
endlocal | |
exit /b %ERRORLEVEL% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment