home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
virus
/
prexcm40.zip
/
PROTECT.BAT
< prev
next >
Wrap
DOS Batch File
|
1993-10-29
|
2KB
|
66 lines
echo off
cls
if '%2'=='' goto oops
if exist %1.%2 goto filefound
:oops
Rem **********************DIRECTIONS****************************
echo To use PROTECT.BAT, the first parameter is the name part of the filename
echo and the second part is the extension.
echo
echo Here is an example to protect MYPROG.EXE:
echo PROTECT MYPROG EXE (There is not dot '.' between the name & extension)
echo Here is an example to protect MYPROG.COM:
echo PROTECT MYPROG COM
echo
echo (Basically, just leave out the period and use a space between the
echo filename and the extension.)
echo
echo Please only use this on files that have not already been compressed!!!
goto end
:filefound
Rem Separate EXE from COM files
if %2==COM goto comfile
if %2==com goto comfile
if %2==Com goto comfile
if %2==COm goto comfile
if %2==cOM goto comfile
if %2==cOm goto comfile
if %2==coM goto comfile
if exist %1.old del %1.old >NUL
if exist %1.tmp del %1.tmp >NUL
rem You can use PKLITE below, but use the -B (Backup) option and change
rem the suffixes from .OLD to .BAK as in:
rem
rem PKLite %1.EXE -B
rem ren %1.Bak %1.Old
rem
LZEXE %1.EXE
if exist %1.old goto exenormal
echo %1.EXE Could Not Be Compressed By LZEXE...
goto end
:exenormal
ren %1.old %1.tmp
protexcm %1.EXE %3
del %1.old >NUL
ren %1.tmp %1.old
echo %1.EXE has been protected, %1.OLD is the original!
goto end
:comfile
rem If you wish to use PKLITE, make the following changes:
rem PKLITE %1.COM -B
rem REN %1.OLD %1.BAK
protexcm %1.COM %3
rem DEL %1.OLD
rem REN %1.BAK %1.OLD
:end