home *** CD-ROM | disk | FTP | other *** search
/ Shareware Supreme Volume 6 #1 / swsii.zip / swsii / 199 / 4LOGIC10.ZIP / 4COPY.BTM < prev    next >
Encoding:
Text File  |  1992-06-25  |  4.1 KB  |  136 lines

  1. :*******************************************************************************
  2. : A 4LOGIC batch utility      A free program. All of the code here is released
  3. :                             to the public domain.
  4. : Name: 4COPY.btm v. 1.0
  5. :
  6. : Author: Brad Owen
  7. :
  8. : Description: COPY files using pick-lists.
  9. :
  10. :*******************************************************************************
  11. @echo off
  12.     cls
  13.     pushd
  14.     iff not exist %_boot:\4dirs.dat then
  15.         cls
  16.         beep 400 2 350 2 400 2 350 2 400 2 350 2
  17.         text
  18.             Error message:
  19.                 4dirs.dat was not found in the root of your boot drive.
  20.                            Run 4UD to create 4dirs.dat.
  21.         endtext
  22.         goto stop
  23.     endiff
  24.  
  25. :GETFROM
  26.     cls
  27.     scrput 8 6 %_fg on %_bg Choose a directory to COPY files FROM
  28.     scrput 10 6 %_fg on %_bg ESC to quit
  29.     scrput 12 6 %_fg on %_bg If you pick a floppy drive insert a
  30.     scrput 14 6 %_fg on %_bg disk BEFORE pressing ENTER.
  31.     set DIRFROM=%@select[%_boot:\4dirs.dat,0,55,22,80,─╢ Copy FROM ╟─]
  32.     if "%DIRFROM"=="" goto stop
  33.     if "%DIRFROM" == "A:" .OR. "%DIRFROM" == "B:" goto GETTO
  34.     iff not isdir %DIRFROM then
  35.         beep 400 2 350 2 400 2 350 2 400 2 350 2
  36.         cls
  37.         echo 4COPY error: The directory you picked to copy files FROM
  38.         echo.
  39.         echo              %DIRFROM
  40.         echo.
  41.         echo is not currently a valid directory on the system.
  42.         echo.
  43.         echo Remedy: Make sure the 4dirs.dat file is current by
  44.         echo running the 4LDD utility.
  45.         echo.
  46.         pause Press a key to exit...
  47.         goto stop
  48.     endiff
  49.     cls
  50.     if "%DIRFROM"=="" goto stop
  51.  
  52. :GETTO
  53.     scrput 8 6 %_fg on %_bg Choose a directory to COPY files TO
  54.     scrput 10 6 %_fg on %_bg ESC to quit
  55.     scrput 12 6 %_fg on %_bg If you pick a floppy drive insert a
  56.     scrput 14 6 %_fg on %_bg disk BEFORE pressing ENTER.
  57.     set DIRTO=%@select[%_boot:\4dirs.dat,0,55,22,80,─╢ Copy TO ╟─]
  58.     if "%DIRTO"=="" goto stop
  59.     if "%DIRTO" == "A:" .OR. "%DIRTO" == "B:" goto FLOPFROM
  60.     iff not isdir %DIRTO then
  61.         beep 400 2 350 2 400 2 350 2 400 2 350 2
  62.         cls
  63.         echo 4COPY error: The directory you picked to copy files TO
  64.         echo.
  65.         echo              %DIRTO
  66.         echo.
  67.         echo is not currently a valid directory on the system.
  68.         echo.
  69.         echo Remedy: Make sure the 4dirs.dat file is current by
  70.         echo running the 4LDD utility.
  71.         echo.
  72.         pause Press a key to exit...
  73.         goto stop
  74.     endiff
  75.     cls
  76.  
  77.     iff "%DIRFROM"=="%DIRTO" then
  78.         cls
  79.         beep 350 2 400 2 350 2 400 2 350 2 400 2
  80.         echo 4COPY error: The FROM and TO directories are the same.
  81.         echo.
  82.         echo Press a key to exit...
  83.         goto stop
  84.     endiff
  85.  
  86. :FLOPFROM
  87.     iff "%DIRFROM"=="A:" .OR. "%DIRFROM"=="B:" then
  88.         iff "%@ready[%DIRFROM]"=="1" then
  89.             goto FLOPTO
  90.         else
  91.             cls
  92.             beep 400 2 350 2 400 2 350 2 400 2 350 2
  93.             echo 4COPY error: Drive %DIRFROM is not ready
  94.             echo to copy files FROM.
  95.             echo.
  96.             echo Insert the disk and then
  97.             pause Press a key to retry...
  98.             goto FLOPFROM
  99.         endiff
  100.     endiff
  101.  
  102. :FLOPTO
  103.     iff "%DIRTO"=="A:" .OR. "%DIRTO"=="B:" then
  104.         iff "%@ready[%DIRTO]"=="1" then
  105.             goto CHANGE
  106.         else
  107.             cls
  108.             beep 400 2 350 2 400 2 350 2 400 2 350 2
  109.             echo 4COPY error: Drive %DIRTO is not ready
  110.             echo to copy files TO.
  111.             echo.
  112.             echo Insert a disk in %DIRTO and then
  113.             pause Press a key to retry...
  114.             goto FLOPTO
  115.         endiff
  116.     endiff
  117.  
  118. :CHANGE
  119.     cdd %DIRFROM
  120.     iff not exist *.* then
  121.         cls
  122.         beep 400 2 350 2 400 2 350 2 400 2 350 2
  123.         echo 4COPY error: %DIRFROM is an empty directory.
  124.         echo.
  125.         pause Press a key to exit...
  126.         goto stop
  127.     endiff
  128.     select /A-S-D copy /R /V (*.*) %DIRTO\
  129.     cls
  130.     goto stop
  131. :stop
  132.     cls
  133.     set DIRFROM=
  134.     set DIRTO=
  135.     popd
  136.