home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 13 / CD_ASCQ_13_0494.iso / news / 2417 / uc2 / u2_exarj.bat < prev    next >
DOS Batch File  |  1993-12-31  |  1KB  |  61 lines

  1. @echo off
  2. echo off
  3. rem (C) Copyright 1993, Ad Infinitum Programs, all rights reserved
  4.  
  5. rem U2_EXARJ.BAT accepts a single parameter: an archive file. It
  6. rem decompresses all files (including hidden ones, etc.) of this archive
  7. rem completely into the current directory. If nothing goes wrong, the files
  8. rem U$~CHK1 and U$~CHK2 are created by this batch file. UC tests for the
  9. rem presence of those files.
  10.  
  11. rem 1. ARJ
  12.  
  13. rem ***  ARJ  ***
  14.  
  15.    rem Add file to archive
  16.  
  17.       echo check > u$~chk1
  18.       ARJ a %1 u$~chk1
  19.  
  20.    rem Errorlevel 4 means the archive cannot be updated (security envelope).
  21.    rem Because of an internal error in ARJ this currently is errorlevel 2.
  22.  
  23.       if errorlevel 2 goto special
  24.       del u$~chk1
  25.  
  26. :special
  27.  
  28.    rem Expand archive
  29.  
  30.       ARJ x -y %1
  31.  
  32.    rem Test for correct expansion
  33.  
  34.       if errorlevel 1 goto error
  35.       if not exist u$~chk1 goto error
  36.       goto ok
  37.  
  38.  
  39. :error
  40. rem *** Error handling ***
  41.  
  42.    if exist u$~chk1 del u$~chk1
  43.    if exist u$~chk2 del u$~chk2
  44.    goto end
  45.  
  46.  
  47. :ok
  48. rem *** Expansion was successfull ***
  49.  
  50.    rem Call 'extra' file, allowing e.g. addition of banners
  51.  
  52.       command /cu2_xtra
  53.  
  54.    rem Create second check file to notify complete success to UC
  55.  
  56.       echo check > u$~chk2
  57.  
  58.  
  59. :end
  60. rem *** End of batchfile ***
  61.