home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR4 / PREXCM31.ZIP / PROTECT.BAT < prev    next >
DOS Batch File  |  1993-08-26  |  2KB  |  55 lines

  1. echo off
  2. rem
  3. rem     With this UNREGISTERED version, you will probably just want to run
  4. rem PROTEXCM.EXE with no parameters and be able to select your files and 
  5. rem have them compressed from Protect!'s listings.
  6. rem 
  7. cls
  8. if '%2'=='' goto oops
  9. if exist %1.%2 goto filefound
  10. :oops
  11. echo To use PROTECT.BAT, the first parameter is the name part of the filename
  12. echo  and the second part is the extension.
  13. echo  
  14. echo Here is an example to protect MYPROG.EXE:
  15. echo   PROTECT MYPROG EXE     (There's no dot '.' between the name & extension)
  16. echo Here is an example to protect MYPROG.COM:
  17. echo   PROTECT MYPROG COM
  18. echo  
  19. echo (Basically, just leave out the period and use a space between the
  20. echo  filename and the extension.)
  21. echo  
  22. echo Please only use this on files that have not already been compressed!!!
  23. goto end
  24. :filefound
  25. if %2==COM goto comfile
  26. if %2==com goto comfile
  27. if %2==Com goto comfile
  28. if %2==COm goto comfile
  29. if %2==cOM goto comfile
  30. if %2==cOm goto comfile
  31. if %2==coM goto comfile
  32. if exist %1.old del %1.old >NUL
  33. if exist %1.tmp del %1.tmp >NUL
  34. rem
  35. rem YOU CAN USE PKLITE BELOW, BUT USE THE -B (BACKUP) OPTION AND CHANGE
  36. rem THE SUFFIXES FROM .OLD TO .BAK as in:
  37. rem  
  38. rem    PKLite %1.EXE -B
  39. rem    ren %1.Bak %1.Old
  40. rem  
  41. lzexe %1.EXE 
  42. if exist %1.old goto exenormal
  43. echo %1.EXE Could Not Be Compressed By LZEXE...
  44. goto end    
  45. :exenormal
  46. ren %1.old %1.tmp
  47. protexcm %1.EXE
  48. del %1.old >NUL
  49. ren %1.tmp %1.old
  50. echo %1.EXE has been protected, %1.OLD is the original!
  51. goto end
  52. :comfile
  53. rem SEE THE COMMENT ABOVE ABOUT PKLITE, BUT ON COM FILES!!!!!!!
  54. protexcm %1.COM
  55. :end