@echo off REM 99 Bottles of Beer in DOS Batch REM First version by Gert-jan Los (los@lsdb.bwl.uni-mannheim.de) REM The file with batch program must be named as "beer.bat" REM Noted by Vladimir Vojacek (vojacek@seznam.cz), 2003-07-03 REM Last modified by Cory Boehne, 2004-01-01 if "%1"=="" goto outer if "%1"=="body" goto body :inner for %%a in ( 9 8 7 6 5 4 3 2 1 0 ) do call beer body %2 %%a goto end :outer for %%a in ( 9 8 7 6 5 4 3 2 1 0 ) do call beer inner %%a goto end :body set num=%2%3 set bottle=bottles if "%num%"=="99" set number=ninety-nine if "%num%"=="19" set number=nineteen if "%num%"=="09" set number=nine if "%num%"=="99" goto skipfirst if "%2"=="0" set num=%3 if "%num%"=="1" set bottle=bottle if "%num%"=="0" goto last echo %number% %bottle% of beer on the wall echo. :skipfirst echo %