Contents of the MCP.DOC file

MCP.DOC -- documentation for MCP.EXE

WHAT IS THIS?

MCP (Master Copy) is kind of like XCOPY, but it normally only overwrites olderfiles and it can move files. It was written primarily for use in keepingdirectory structures shared by different people (or by the same person ondifferent computers) in synchronization with each other. It is also a quickway to implement disk mirroring style backups.

On the command line, source is a file name or directory name, which mayoptionally include drive and path. It may also include DOS wild cards ? and*. If the source is a directory, the file name *.* is assumed.

The destination is a file name or directory. If no destination is specified,the current directory is assumed. If there are wild card characters in thedestination file name, they will be filled in with the correspondingcharacters in the source file name. If it is not obvious if the destinationis a file or directory, you may be asked which you meant. To ensure that thedestination is interpreted as a directory instead of a file, end the directoryname in "\" or ensure that the destination directory already exists. If thedestination directory does not exist, it will be created.

Switches all start with "/" (not "-", since - is a valid file name characterin DOS), and may be before, between, and/or after the source and destination. Switches may be combined. In case of a conflict between switches, the onethat is farthest to the right on the command line takes precedence. Forbrevity, command line switches may be run together after a single "/". Switches are not case sensitive.

/A (Archive) and /M (Modify archive) both specify that only files that havethe DOS directory archive bit set (indicating that they have been changedsince they were last backed up) should be copied. /A does not alter thearchive bit on the source file. /M clears the archive bit of the source fileto indicate that it has been backed up. The archive bit of the destinationfile is always set when using MCP. These options can be used for backing updata when the largest file you want to back up will fit on your destinationmedia. If the largest file you want to back up is bigger, a regular backupprogram is more appropriate than MCP. However, for some small but importantfiles, backing up with a copy command like MCP makes more sense, because thefile itself is not altered, making restoration possible even without theoriginal backup program.

For example,MCP /A C:\WORK\DOC\*.* A:copies all files in C:\WORK\DOC to the floppy disk in A: that have not beenmarked as backed up.

/D (Date) is always followed by a date, with no space in between the /D andthe date. The colon following the D is optional. The order of the date ismonth day year if you use "/" or "-" to separate the numbers in the date. Ifyou use "." to separate the numbers in the date, the order is day month year. The year can be specified with either the last two digits or all four digits. If you specify the last two digits, the year is assumed to be in the range1980 through 2079. The month must be expressed as a number between 1 and 12. Leading zeros on month and day are optional.

For example, the following commands all copy everything with a file date on orafter December 25, 1991 from the current directory to D:\SAVE\.

/F (Force) forces overwriting of Hidden, System, and Read Only files. WARNING: use this option with caution. It is very useful for somesituations, but could have some undesired side effects if you overwrite somefiles of this type.

/H (Hidden & system) allows files with the system and hidden attribute to becopied. Note that the XCOPY that comes with DOS 5 will not copy hidden files,but earlier versions will. The system and hidden attributes will be appliedto the destination files when they are present in the source files. Note: copying the two hidden system files from a boot drive to another drive willnot necessarily make the destination bootable. Use the DOS SYS command forthat purpose.

/L (Loud) causes extra screen output to be generated, including the names ofall files that are skipped.

/N (No overwrite) prevents any destination files from being overwritten,regardless of the file dates and attributes involved. The default is to allowoverwrites of destination files with an earlier file date. This is theopposite of /O (Overwrite always).

/O (Overwrite always) causes destination files to be overwritten regardless ofits file date. The default is to allow overwrites only of destination fileswith an earlier file date. This is the opposite of /N (No overwrite).

/P (Prompt) asks you if you want to copy each file with a Y/n prompt. "N" or"n" will cause the file to be skipped. Most other keys, including "Y" and "y"will cause the file to be copied. The "Enter" key need not be pressed afterthe "y" or "n".

For example,MCP /P *.* A:lets you pick exactly which files you want to copy to drive A:, one by one.

/Q (Quiet) suppresses all screen output except for error messages and the helpscreen in response to a command line error or /?.

For example,MCP /Q /M C:\WORK\*.* F:\MASTER\FRED\in a network login script would be a subtle way to back up some criticaldirectory on a users's hard disk to a network directory, where it could bemoved to tape or something.

/R (Rename or move) causes files to be renamed if the source and destinationare on the same disk, or copied then the original deleted (after a successfulcopy) if the source and destination are on different disks. If the copyfails, the original is left intact. When used with the /S option, emptiedsubdirectories are not removed.

For example,MCP C:\STUFF\*.DOC D:\OLDJUNK\ /Rmoves every .DOC file in C:\STUFF\ to D:\OLDJUNK\.

/S or /E (Subdirectory copy) copies files and subdirectories from thedestination to the source, making subdirectories as needed. Emptysubdirectories are created as well. Using /S and/or /E on the command line ofMCP is the same as using both /S and /E on the command line of XCOPY.

/V does nothing.

/W (Wait) causes the prompt "Press a key when ready to start copy . . ." to bedisplayed, and the program to pause until you hit a key before starting thecopy process. This is for use with floppy only systems, where the MCP commandmay reside on a disk other than the one you want do do the copy on.

/? (Help) shows the help screen.

ZERO LENGTH FILES

Unlike XCOPY, MCP copies zero length files and, if copying subdirectories,always copies empty subdirectories. It also duplicates the file attributes(system, hidden, read only) of the source file in the destination file, exceptfor the archive bit, which is always set in the destination file.

PROMPTS

There are several prompts possible in MCP. At each of the prompts, thedefault answer (if applicable) is indicated with a capital letter. Answers tothe prompts are not case sensitive, and are all only one keystroke. Pressing"Enter" after a letter is not required. The "Enter" key is ignored at allprompts except for the "Press a key when ready to start copy . . ." promptcaused by the /W option. In addition to the listed responses at any prompt,"Esc", "Ctrl-C", and "Ctrl-Break" will terminate MCP. "Ctrl-Break" will alsoterminate a copy in progress, even if the program is not looking for an answerto a question.

filename Y/n?

This is the format used in asking if you want to copy a particular file whenyou put /P on the command line. "N" means that you do not want to copy thefile, and most other keys (including "Y") mean that you do want to copy thefile.

Only 512 bytes available on A:. filename requires 1234 bytes.Retry with new disk, Try new disk later, Skip, or Cancel (r/T/s/c)?

If your destination is on a fixed disk, press "S" to skip just this file or"C" to cancel and exit MCP. If your destination is a removable disk, you mayskip the current file or cancel as with a fixed disk destination. You mayalso wish to change disks and then press "R" to retry copying the currentfile, or press "T" to try copying the next file (which may fit) and add thecurrent file to a list to be tried again later (on a different floppy disk). Most other keys act the same as "T".

No more room on drive A:Retry with new disk, Skip or Cancel (R/s/c)?

Your destination disk has no more room on it. Change the disk and press "R"to retry, or "C" to exit the MCP program.

Error writing to filename.Retry, Skip, or Cancel (r/S/c)?

MCP encountered one of many possible errors (insufficient network rights, baddisk sectors, hardware failures, disk full even though it had enough room tostart the copy, etc.). "R" restarts the copy from the beginning of the file. "S" skips this file and tries the next. "C" cancels the copy and exits MCP.

Does destination specify a File nameor Directory on the target (f=File, D=Directory)?

The destination directory is not an existing directory and the name does notend with "\", and there may be more than one source file (indicated by wildcards in the name or a /S or /E switch). Press "F" if you intended that thedestination is a file name, or "D" if you intended that the destination is adirectory. If you decide that the command line was in error, press "Esc".

Press a key when ready to start copy . . .

You used the /W option. Press "Esc", "Ctrl-C", or "Ctrl-Break" if you decideyou really didn't want to copy anything after all, or press any other key tostart the copy process.

ERROR MESSAGES

Break!

You pressed Ctrl-Break, Ctrl-C, or Esc to halt the program.

Unable to create filename

The destination file name may have been on an invalid drive, have containedinvalid characters, been in the root directory with all directory entriesfilled, been on a network directory with insufficient rights, been too longfor DOS or the network operating system to create, or some other similarproblem.

Files may not be copied onto themselves.

The first step in copying a file is to create a new file of zero length withname of the destination file. If the source and destination files are thesame, this action would destroy the source file.

Destination path is too long.

The most likely cause of this error message is starting a recursive copycommand (like MCP /S C:\*.* C:\SUBDIR\). This causes everything in the rootdirectory of drive C: to be copied to C:\SUBDIR\ and C:\SUBDIR\SUBDIR\ andC:\SUBDIR\SUBDIR\SUBDIR\ and so on. Older versions of XCOPY allow this, thelatest one does not. MCP allows the recursion to go on until the resultingpath name exceeds DOS limits. This is a great way to fill up a hard disk in ahurry.

Not enough memory to run MCP.EXE

Try reducing the number of TSR programs, or if you are shelled out to DOS fromanother program, exit that other program.

Access denied.

DOS (or some network software) returned an error code indicating that theoperation was not allowed. Some things that can do this is trying to create adirectory when a file with the same name already exists or trying to write toa network directory where you have insufficient rights.

MCP does not concatenate files (use DOS COPY to do that), so copying more thanone file to a single file means that all that ends up in the destination fileis the last file copied. If this were done with the /R option, all but thelast file would be destroyed. Therefore, only one file is allowed to becopied to a file. The trap that catches this is not foolproof (although it isreasonably difficult to fool), so you should still take care on the commandline to avoid specifying such an action.

Unable to open filename

The specified file name may not be valid, or may be on a network directorywhere you have insufficient rights.

Ran out of memory keeping track of files to retry.

Each file name source and destination that is "remembered" to try later whenyou run out of room copying to a diskette takes up some conventional RAM. After several thousand of these (more or less, depending on how much RAM youhave available), you may run out.

ERRORLEVEL

When running MCP in a batch file, you can test for the following values ofERRORLEVEL after MCP runs:

0 = Normal completion.2 = "Ctrl-Break", "Ctrl-C", or "Esc" pressed, or copy canceled with "C".3 = Unable to write to destination file.4 = Attempted to copy file onto itself.5 = Destination path is too long.6 = Not enough memory to run.7 = Access denied.8 = Bad file number error returned by DOS.9 = Attempt to copy more than one file to one destination file.11 = Command line error or help requested.12 = Unable to open input file.13 = Ran out of memory keeping track of files to retry.

A COPY PROGRAM BY ANY OTHER NAME

MCP comes from M as in Master or Mike's and CP as in the name for the Unixcopy command. Call it whatever you like, by renaming it, creating an aliaswith DOSKEY or a similar utility, or by creating a batch file. You might wantto create a batch bile called MOVE.BAT (or MV.BAT) that contains the line:

MCP /R %1 %2 %3 %4 %5 %6 %7 %8 %9

LIMITATIONS

MCP does not do concatenation. It does not get the date format from the DOScountry table. It does not do Japanese dates in year-month-day format. Allof its error messages are in English. It does not do a full screen interface.It doesn't skip zero length files just because they are zero length. Itdoesn't skip creation of empty subdirectories when /S is used. /V doesabsolutely nothing. It doesn't remove any subdirectories. It doesn't predictwinning lottery numbers. On the other hand, it does do some things that Ialways thought that XCOPY should have done.

Registration entitles you to support on the Rainbow Missions BBS(303-938-9654) and by mail, and to notification of major upgrades at discountrates.

Although I try to write perfect software, there is a chance that I goofed upin some way. If you find this to be the case, please let me know so that Ican repair it. Because I can't test every possible use of this software onevery system that it might be run on, and because I have no control over theway shareware gets passed around, you use this software entirely at your ownrisk. Prices are subject to change without notice.