@echo off
set cmdext=cmd
cls
echo ----------- batch unpacker file maker using TYP. ----------------------------
if [%1]==[?] goto hilfe
if [%1]==[/?] goto hilfe
if [%1]==[/H] goto hilfe
if [%1]==[/h] goto hilfe
if [%1]==[-?] goto hilfe
if [%1]==[-H] goto hilfe
if [%1]==[-h] goto hilfe

if exist _~_.%cmdext% del _~_.%cmdext%
echo þ running TY /resource+ /cpu- /ico- /partition- /unpacker:_~_.%cmdext% /ba:nul
if not [%1]==[] echo   for %1 %2 %3 %4 %5 %6 %7 %8 %9
call ty %1 %2 %3 %4 %5 %6 %7 %8 %9 /resource+ /cpu- /ico- /partition- /unpacker:_~_.%cmdext% /ba:nul
if errorlevel 1 goto typein

if exist _~_.%cmdext% goto success
echo þ TY did not find anything useful to extract
goto ende

:success
echo þ running _~_.%cmdext%
call _~_.%cmdext%
goto ende

:typein
echo You have to create TY.CMD/TY.BAT first.
echo run TYPEIN.EXE/TYPEIN2.EXE/TYPEIN3.EXE
pause
goto ende

:hilfe
echo Usage: %0 filenames filemasks ...
goto ende

:ende
echo .
echo -----------------------------------------------------------------------------
