@echo off
echo Retrieving %1.pak from library
IF EXIST pak8.pak goto PAK9
IF EXIST pak7.pak goto PAK8
IF EXIST pak6.pak goto PAK7
IF EXIST pak5.pak goto PAK6
IF EXIST pak4.pak goto PAK5
IF EXIST pak3.pak goto PAK4
IF EXIST pak2.pak goto PAK3
IF EXIST pak1.pak goto PAK2
IF EXIST pak0.pak goto PAK1

:PAK0
rename %1.pak pak0.pak
echo rename pak0.pak %1.pak >> put_back.bat
goto END

:PAK1
rename %1.pak pak1.pak
echo rename pak1.pak %1.pak >> put_back.bat
goto END

:PAK2
rename %1.pak pak2.pak
echo rename pak2.pak %1.pak >> put_back.bat
goto END

:PAK3
rename %1.pak pak3.pak
echo rename pak3.pak %1.pak >> put_back.bat
goto END

:PAK4
rename %1.pak pak4.pak
echo rename pak4.pak %1.pak >> put_back.bat
goto END

:PAK5
rename %1.pak pak5.pak
echo rename pak5.pak %1.pak >> put_back.bat
goto END

:PAK6
rename %1.pak pak6.pak
echo rename pak6.pak %1.pak >> put_back.bat
goto END

:PAK7
rename %1.pak pak7.pak
echo rename pak7.pak %1.pak >> put_back.bat
goto END

:PAK8
rename %1.pak pak8.pak
echo rename pak8.pak %1.pak >> put_back.bat
goto END

:PAK9
rename %1.pak pak9.pak
echo rename pak9.pak %1.pak >> put_back.bat

:END
call counter

