To simplify the work with batch files you can use some pseudo-functions to not write one code two times. Here is a sample to prove this:
@echo off
rem call function...
call:myDosFunc 2 2
rem call again...
call:myDosFunc 3 4
echo.&pause&goto:eof
:myDosFunc
echo this is param %~1
echo this is param %~2.
goto:eof
When you use this you have to be carefully to not generate spagheti code; this options is also a posibility to get this programming problem.
In the end, you can see two links to get more informations about this subject:
http://www.dostips.com/DtTutoFunctions.php#FunctionTutorial.CreatingAFunction
http://www.commandline.co.uk/cmdfuncs/index.html
1165505c-3735-4f21-a28a-c45e678f06dc|0|.0