rem ... rem (assuming this script is named setup.bat) if exists setup.bat goto havesetup echo Can't find myself. Can't install. goto fail :havesetup rem (assuming our perl.exe is in a bin subdirectory) if not exists perl.exe goto dirsok echo ZIP file was unpacked without directories. Can't install. goto fail :dirsok if exists bin\perl.exe goto haveperl echo Missing my perl.exe. Archive damaged? Can't install. goto fail :haveperl rem ... rem ... use perl to bootstrap itself rem ... :fail pause :end