home *** CD-ROM | disk | FTP | other *** search
-
- bat *
- bat * The file HCOPY.BAT
- bat * ==================
-
- bat * Selective copying of files - Command: HCOPY <wildcard spec>
-
- bat * also a demonstration of the READSCRN command for 80 col display
-
- bat * Written 1/25/83
- bat * Copyright 1983 by Frank Canova and Seaware Corp.
- bat * Extensions 6/28/84 by Egin Muth
- bat * For DOS 2.0 and hard disk systems
- bat * Improved error handling
- bat * Command may be issued with parm (filespec)
- bat * Handles the funny dots in DOS 2.0 directory
- bat * Prettied up screen presentation
- bat * May quit during query
- bat * May cancel copy operation
- bat * Copy from A: to A: via hard disk subdirectory C:\KOPY
- bat *
-
- bat if %1 = A2A GOTO -A2A
- echo off
- bat cls
- bat if .%1 <> . type | GOTO -rd.1
- bat begtype
-
- Selective file copying (including from A: to A:)
-
- First give a global filespec (e.g.: *.BAS)
-
- Then choose one by one: Y=yes N=no Q=quit
-
-
-
- end
- bat * Make sure that we know where data is traveling from/to
- bat READ Enter a wild card spec , or press enter for all files %1
- bat TYPE
- bat -rd.1 INKEY Which drive is the "from" diskette? (A, B, C, or D) %4
- bat CALL -check | %2 = %4: | IF .%4 = . GOTO -rd.1
- bat TYPE
- bat -rd.2 INKEY Which drive is the "to" diskette? (A, B, C, or D) %4
- bat CALL -check | %3 = %4: | IF .%4 = . GOTO -rd.2
- bat IF %2 <> a: IF %3 = %2 call -errmsg | GOTO -rd.1
- bat %O = 0
- bat If %3 = %2 %O = A2A | %3 = c:\kopy | * copy from A to A via hard disk
- bat * Get a directory of "from" to start asking questions about.
- bat CLS
- DIR %2%1/w
- bat
- bat STACK.ON | * Make sure another program didn't set this off
- bat * Start reading from bottom of screen, skip all blank lines
- bat -ignore READSCRN %k | if .%k = . goto -ignore
-
-
- bat * Verify that have something to copy.
- bat IF %K = file type no files are available to copy | exit
- bat IF %K = 0 type no files are available to copy | exit
-
- bat %L = y | %M = %S%S%S%S%S%S%S
-
- bat * Get upto 5 file names on each line.
- bat -read.dline READSCRN %A %B %C %D %E %F %G %H %I %J
- bat IF %R = 4 GOTO -query | * Directory header above line 4, ignore
-
-
- bat * Save on the keyboard stack all the file names if they exist.
- bat IF %A = . %K = %K - 2 | skip 1
- bat IF .%A <> . STACK %A .%B
- bat IF .%C <> . STACK %C .%D
- bat IF .%E <> . STACK %E .%F
- bat IF .%G <> . STACK %G .%H
- bat IF .%I <> . STACK %I .%J
- bat GOTO -read.dline
-
-
- bat -query CLS
- bat TYPE
- bat TYPE %k files found for copy from %2 to %3
- bat TYPE
- bat -q.loop READ %A %B |* Read file name off of stack
- bat %C = %A%M $ 1 8 | %F = %C%B
- bat IF %L = n goto -q.loop.n
- bat if %K < 10 %k = 0%k
- bat -q.loop2 TYPE %S%S%k %S%S Copy %S%S%S %F %S%S (Y, N, Q) ?%S ;
- bat INKEY %C |* Does user want to copy this one?
- bat IF %C = y TYPE Yes | SKIP 3
- bat IF %C = n TYPE No | SKIP 3
- bat IF %C = q TYPE Quit | %L = n | GOTO -q.loop.n
- bat BEEP GOTO -q.loop2
- bat -q.loop.y STACK copy %2%A%B %3 | * Stack the copy command
- bat -q.loop.n %k = %K - 1
- bat IF %K <> 0 GOTO -q.loop
-
- bat * Remove any other messages that DOS might have put on the directory
- bat * which might have gotten stacked during the READSCRN above.
- bat -clean.stack
- bat IF %q = k skip 3
- bat READ %A %B %C
- bat IF %A <> copy GOTO -clean.stack
- bat STACK %A %B %C
-
-
- bat * check whether copy is from A to A, i.e. via hard disk \kopy
- bat IF %O = A2A STACK vcopy A2A
-
- bat * Verify that user is ready. DOS will pull the copy commands off of the
- bat * keyboard stack after the EXIT
- bat -prompt BEEP
- bat TYPE
- bat INKEY Ready to copy - Press any key - Q to cancel . . . %a
- bat CLS
- bat TYPE
- bat IF %a = q stack.purge | type copying cancelled
- bat EXIT
-
- bat -A2A CLSP
- bat BEGTYPE
-
-
- Insert copy-to diskette in drive A, then press any key . . .
-
-
- end
- bat BEEP
- bat INKEY
- bat STACK Y
- COPY c:\kopy\*.* a:
- DEL c:\kopy\*.*
- bat EXIT
-
-
- bat * This is a subroutine which checks the drive spec for validity.
- bat -check
- bat %5 = %4 # | IF %5 = 1 TYPE %4
- bat IF %4 = A SKIP 4
- bat IF %4 = B SKIP 3
- bat IF %4 = C SKIP 2
- bat IF %4 = D SKIP 1
- bat %4 = | call -errmsg
- bat -chk.ok RETURN
-
- bat -errmsg
- bat beep
- bat begtype
- >>> Bad drivespec - try again
-
- end
- bat RETURN