home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / flist58.zip / FLCOPY.CMD < prev    next >
OS/2 REXX Batch file  |  1990-02-26  |  831b  |  30 lines

  1. @echo off
  2. rem This is an example of how to implement a feature in FLIST that is not
  3. rem directly supported. The function that we are implementing is
  4. rem 'Copy within same directory to a different file'. This CMD file also
  5. rem demonstrates how to use TJD Software's MLINE program to ask if an
  6. rem existing file may be overwritten.
  7. rem
  8. rem To tell FLIST to run this command when the '1' key is pressed do:
  9. rem SET $FUSR1$=%COMSPEC% /c FLCOPY $FN.$FE $P
  10. rem
  11. if .%1 == . GOTO Usage
  12. if .%2 == . GOTO Usage
  13. if .%3 == . GOTO Doit
  14. GOTO Usage
  15. :Doit
  16. if EXIST %2 GOTO Prompt
  17. GOTO DOCOPY
  18. :Prompt
  19. mline "File %2 already exists - Overwrite it?" Yes No
  20. if ERRORLEVEL 1 GOTO End
  21. :DOCOPY
  22. copy %1 %2
  23. GOTO End
  24. :Usage
  25. echo Usage is:
  26. echo         %0 file1 file2
  27. rem Run MLINE with no arguments to set ERRORLEVEL
  28. mline
  29. :End
  30.