home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
utility
/
cpy11a.zip
/
CPY.TXT
< prev
next >
Wrap
Text File
|
1992-04-24
|
16KB
|
341 lines
COPY UTILITY
(Version 1.1A Maintenance Release, 4/24/92)
*******************************************************
* *
* This version includes 2 NEW PARAMETERS: *
* *
* * 'V' copies the volume label which follows *
* to the volume of target file specification. *
* *
* * 'Z' searches all non-floppy drives (C,D,E *
* etc.) for the source file specification. *
* *
* *
* It also includes these BUG FIXES: *
* *
* * The "Target file spec not allowed" error *
* message no longer appears when a valid *
* target file spec is given. *
* *
* * The program no longer bombs if NO source *
* file spec extension is given. *
* *
* * The program processes correctly if Search *
* and Confirm parameters are off (-SOFF and *
* -COFF respectively) instead of always *
* finding no files. *
* *
*******************************************************
NAME: CPY
DESCRIPTION: CPY is a fast and powerful utility which can optionally:
* SEARCH for wildcard-delimited files and/or directories
on your entire drive, the current directory and all
subordinate directories, or just the current directory
* COPY or MOVE all found files and/or directories to a
specified location
* RENAME any duplicate files being copied or moved to the
specified location
* CONFIRM all copy/move/rename activity before execution
(giving you a last chance to change your mind!)
FORMAT: CPY [Parm] [Parm] [Parm] [\Spath1\]Sfn1.Sfx1...
[Parm] [Parm] [Parm] [\Spathn\Sfnn.Sfxn] [\Tpath\Tfn.Tfx]
Where...
Parm [optional] is a parameter. See explanation below.
\Spath1\ [optional] is complete path of the first source file
spec. If no path is given, current directory is assumed.
SFn1.SFx1 is name and extension of the first source file spec.
Wildcards (*,?) can be used as delimiters.
\SPathn\ [optional] is path, name and extension of each
Sfnn.Sfxn additional source file spec. Wildcards can be used
as delimiters.
\Tpath\ [optional] is path, name and extension of the target
Tfn.Tfx file spec. If none is given, the current directory
is assumed.
PARAMETERS Each parameter has three parts:
* a dash (-)
* the parameter type (1, B, C, D, E, F, G, J,
M, O, P, Q, S, T, X, Z)
* an on/off indicator (1, C, D, F, J, M, O, Q, S, X, Z)
OR
a file you specify (G, P, T)
OR
a date you specify (B, E)
OR
a volume label you specify (V)
(For example: -SON, -COFF, -T\DIR1\TEST.LOG)
PARAMETER If Parameter is ON If Parameter is OFF
----------------------------------------------------------------
1 Copies source files and Recreates existing source
directories to target directory structure off
directory. target directory.
B Uses date which follows No date range is used
as beginning date of a as selection criteria.
date range for selection
criteria.
C Confirms all copy/move/ Automatic execution
rename activity prior to
execution.
D Creates unique filenames Each duplicate file being
for all duplicate files moved or copied replaces
copied or moved to the (overwrites) duplicate
target directory. A in target directory.
number (0-9) replaces Only the last-moved
the last character of duplicate remains once
each duplicate file's copy or move is done.
extension.
E Uses date or number which No date range is used
follows as end date of a as selection criteria.
date range for selection
criteria.
F Mirrors execution without Automatic execution
doing anything ("Fakes"
it so you can see the
consequences).
G Creates a log file that No log file
records execution.
J Searches for source files Searches only specified
or directories just on directory.
the PATH specified in
your Autoexec.bat file.
M MOVES all source files/ COPIES all source files/
directories to target. directories to target.
O On a MOVE, deletes Read No deletion of Read Only
Only source files (it files
has no effect on a
COPY since source files
are never deleted).
P Gets parameters and/or You must type all file
file specs for run from specs and/or parameters.
a file you specify.
Q Executes CPY without Displays results on
displaying results on screen.
screen ("Quiet" mode).
S Searches specified source Searches only specified
directory PLUS all sub- source directory.
ordinate directories for
files and/or directories
meeting source file spec.
T Uses information which Uses current directory
follows as target file as target file spec.
spec. If directory does
not exist, CPY creates it.
V Copies volume label which Does not change target
follows to volume of the volume's label.
target file specification.
The existing target volume
label must conform to
normal DOS volume label
standards in order to be
overwritten.
X Changes date of all files Does not change date.
moved or copied to target
directory to the system
date on your computer.
Z Searches all non-floppy Searches current drive.
drives (C, D, E etc.)
for the source file
specification.
NOTES: 1) All parameters except 'C' are OFF by default. You
only specify parameters to change these settings.
Parameter settings remain active for current run
of CPY unless you change them.
2) You can specify any combination of parameters for
each source file spec. However, these combinations
do NOT make sense:
* Having 'C' (confirm) and 'F'(fake execution) ON at
the same time
* Having 'O' (delete Read Only source files) ON for a
COPY run since no files are deleted on a copy
* Having 'J' (search your Path) and 'S' (search
specified and all subordinate directories) ON at
the same time
3) When using DATE RANGE parameters 'B' and 'E',
enter date/time in this format: MM-DD-YYYY_HH-MM.
A / can be used instead of -. Also, the hours/
seconds section (_HH-MM) is optional.
For the END date ('E'), you can enter an integer
instead of a date. This number can be positive or
negative and indicates the total period of the date
range. For example, 10 means a date ten days AFTER
the beginning date. -10 means a date ten days BEFORE
the beginning date. If no date is entered, the
current date is assumed.
4) You can interrupt CPY during execution by pressing
any key. If you respond 'N' to the confirmation
message which appears, processing for the current
run terminates.
5) If a directory meets the specified source file spec,
CPY copies or moves that directory PLUS all files
and/or directories in it.
6) When using VOLUME LABEL parameter 'V', if you do
NOT specify a volume label the current one from the
last-named source file specification is used. For
example, if you name source file specs from drives
C and D, the volume label from D is written on the
volume of the target file specification.
EXAMPLE 1 CPY SOURCE1.FIL SOURCE2.FIL SOURCE3.FIL -T\DIR1
This searches the current directory for three source files.
If any exist, a confirmation message appears. If you respond
'Y', the files are copied to the DIR1 target directory.
EXAMPLE 2 CPY -SON -COFF -MON \DIR1\*.BAK
This searches the DIR1 directory--and all subordinate
directories--for non-Read Only files with an extension of BAK.
It then MOVES those files to the current directory without
confirming that activity.
EXAMPLE 3 CPY -COFF -MON -OON -FON ANYFILE.* -T\NEWDIR
This searches the current directory for all files named ANYFILE.
It then "fakes" moving all such files to NEWDIR so that you can
see which files will be affected IF you execute this command.
NOTE: To really move these files, press F3, type '-FOFF' to turn
the Fake option off, and then press Enter. '-OON' directs all
Read Only source files to be moved and then deleted from the
current directory along with non-Read Only files.
EXAMPLE 4 CPY -P\DIR1\PARM.FIL
This directs CPY to file PARM.FIL for all parameters and file
specs. If that file contains this information...
-SON -MON -COFF -QON C:\*.BAK -T\BACKUP
CPY searches the C drive for all non-Read Only BAK files. It
then moves all such files to the BACKUP directory. No confirm-
ation message is displayed (-COFF), and execution is not echoed
on the screen (-QON).
EXAMPLE 5 CPY -DON -G\DIR1\LOG.FIL C:\SOMEFILE.* -T\DIR2
This searches the C drive for all non-Read Only files named
SOMEFILE. It then confirms total files found. If you respond
'Y', it copies those files to the TARGET1 directory. A log
file LOG.FIL records execution (ie, captures everything that
appears on the screen).
NOTE: -DON tells CPY to uniquely rename all duplicate files
copied to DIR2. For example, if there were four SOMEFILE.BAK
files the last three would have their extensions renamed BA0,
BA1 and BA2 respectively.
EXAMPLE 6 CPY -SON -OON -MON C:\DIR1\*.BAK -T\TARGET1 -COFF D:\*.BAK
This searches the DIR1 directory--and all subordinate
directories on your C drive--for files with an extension
of BAK. It then confirms total files found. If you respond
'Y', it moves those files to the TARGET1 directory.
Finally, it searches the D drive for .BAK files and moves
them to the current directory. NB: No confirmation message
appears since that parameter has been turned off (-COFF).
EXAMPLE 7 CPY -SON -1ON \DIR1\*.* -T\NEWDIR
This searches the DIR1 directory--and all subordinate
directories--for all files. It then copies those files to
the new directory NEWDIR.
NOTE: If '1' were OFF, the existing subdirectory structure would
be recreated under NEWDIR.
EXAMPLE 8 CPY -SON -B04/11/1992_10:30AM -E05/11/92 C:\*.BAK -T\NEWDIR
This searches your C drive for .BAK files with dates between
April 11th, 1992 at 10:30AM and May 11th, 1992. It then
confirms all files found, and if you respond 'Y' it copies
them to NEWDIR.
EXAMPLE 9 CPY COFF -MON -B01-01-1992 *.ZIP -T\NEWDIR
This searches the current drive for ZIP files with 1992 dates.
It then moves those files to NEWDIR. Note that the current
date is used by default for END date since none is specified.
EXAMPLE 10 CPY -JON -DON -XON *.BAK -T\DUPEFLES
This searches all directories specified in your Autoexec.bat's
PATH command for .BAK files and confirms the total found. If
you respond 'Y', it copies those files to the DUPEFLES directory
and changes their dates to the system date. It also creates
unique filenames for any duplicates.
EXAMPLE 11 CPY -SON -VNEWLABEL -ZON \DIR1\*.BAK -T\DUPEFLES
This searches for .BAK files on all DIR1 directories on all
non-floppy drives, then confirms the total found. If you respond
'Y', it copies them to the DUPEFLES directory and changes the
target volume's label to NEWLABEL.
---End of Document ( CPY.TXT )