home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / UTILS / MCP103.ZIP / MCP.DOC < prev    next >
Text File  |  1992-09-20  |  17KB  |  399 lines

  1. MCP.DOC -- documentation for MCP.EXE
  2.  
  3.  
  4. WHAT IS THIS?
  5.  
  6. MCP (Master Copy) is kind of like XCOPY, but it normally only overwrites older
  7. files and it can move files.  It was written primarily for use in keeping
  8. directory structures shared by different people (or by the same person on
  9. different computers) in synchronization with each other.  It is also a quick
  10. way to implement disk mirroring style backups.
  11.  
  12.  
  13. HOW DO I RUN MCP?
  14.  
  15. Syntax:
  16. MCP.EXE source [destination] [switches]
  17.   /A = copy only files with Archive bit set (leave source archive bit set)
  18.   /C = copy & overwrite all files except those with identical date, time & size
  19.   /D = copy files with date the same or later than Date given /D:mm-dd-yyyy
  20.        /D:dd.mm.yyyy /Dmm/dd/yy or /Ddd.mm.yy
  21.   /F = Force overwrite of system, hidden, and read only files
  22.   /H = Copy system and hidden files as well.
  23.   /L = Verbose output
  24.   /M = copy only files with archive bit set (Modify source archive bit)
  25.   /N = No overwrite
  26.   /O = Overwrite destination files
  27.   /P = Prompt before copy
  28.   /Q = Quiet (report only errors)
  29.   /R = Rename or move files
  30.   /S = /E = recurse through Subdirectories (& create empty ones)
  31.   /V = This switch doesn't cause an error message, but it doesn't do anything.
  32.        It is included so that batch files written for XCOPY can use MCP with
  33.        the same switches.  (/V turns verify on in XCOPY).
  34.   /W = Wait for keystroke before starting copy
  35.   /? = Show help screen.
  36.  
  37. On the command line, source is a file name or directory name, which may
  38. optionally include drive and path.  It may also include DOS wild cards ? and
  39. *.  If the source is a drive or directory, the file specification *.* is
  40. assumed.
  41.  
  42. The destination is a file name or directory.  If no destination is specified,
  43. the current directory is assumed.  If there are wild card characters in the
  44. destination file name, they will be filled in with the corresponding
  45. characters in the source file name.  If it is not obvious if the destination
  46. is a file or directory, you may be asked which you meant.  To ensure that the
  47. destination is interpreted as a directory instead of a file, end the directory
  48. name in "\" or ensure that the destination directory already exists.  If the
  49. destination directory does not exist, it will be created.
  50.  
  51. Switches all start with "/" (not "-", since - is a valid file name character
  52. in DOS), and may be before, between, and/or after the source and destination. 
  53. Switches may be combined.  In case of a conflict between switches, the one
  54. that is farthest to the right on the command line takes precedence.  For
  55. brevity, command line switches may be run together after a single "/". 
  56. Switches are not case sensitive.
  57.  
  58. /A (Archive) and /M (Modify archive) both specify that only files that have
  59. the DOS directory archive bit set (indicating that they have been changed
  60. since they were last backed up) should be copied.  /A does not alter the
  61. archive bit on the source file.  /M clears the archive bit of the source file
  62. to indicate that it has been backed up.  The archive bit of the destination
  63. file is always set when using MCP.  These options can be used for backing up
  64. data when the largest file you want to back up will fit on your destination
  65. media.  If the largest file you want to back up is bigger, a regular backup
  66. program is more appropriate than MCP.  However, for some small but important
  67. files, backing up with a copy command like MCP makes more sense, because the
  68. file itself is not altered, making restoration possible even without the
  69. original backup program.
  70.  
  71. For example,
  72. MCP /A C:\WORK\DOC\*.* A:
  73. copies all files in C:\WORK\DOC to the floppy disk in A: that have not been
  74. marked as backed up.
  75.  
  76. /C (Copy & overwrite all but identical date, time & size) will cause all
  77. destination files with the same name but different (older or newer) date &
  78. time or different size (smaller or larger) to be overwritten.
  79.  
  80. /D (Date) is always followed by a date, with no space in between the /D and
  81. the date.  The colon following the D is optional.  The order of the date is
  82. month day year if you use "/" or "-" to separate the numbers in the date.  If
  83. you use "." to separate the numbers in the date, the order is day month year. 
  84. The year can be specified with either the last two digits or all four digits. 
  85. If you specify the last two digits, the year is assumed to be in the range
  86. 1980 through 2079.  The month must be expressed as a number between 1 and 12. 
  87. Leading zeros on month and day are optional.
  88.  
  89. For example, the following commands all copy everything with a file date on or
  90. after December 25, 1991 from the current directory to D:\SAVE\.
  91.  
  92. MCP /D12/25/91 *.* D:\SAVE\
  93. MCP /D:12/25/91 *.* D:\SAVE\
  94. MCP *.* D:\SAVE\ /D12/25/1991
  95. MCP /D12-25-91 *.* D:\SAVE\
  96. MCP *.* /D12-25-1991 D:\SAVE\
  97. MCP /D25.12.91 *.* D:\SAVE\
  98. MCP /D:25.12.1991 *.* D:\SAVE\
  99.  
  100. /F (Force) forces overwriting of Hidden, System, and Read Only files. 
  101. WARNING:  use this option with caution.  It is very useful for some
  102. situations, but could have some undesired side effects if you overwrite some
  103. files of this type.
  104.  
  105. /H (Hidden & system) allows files with the system and hidden attribute to be
  106. copied.  Note that the XCOPY that comes with DOS 5 will not copy hidden files,
  107. but earlier versions will.  The system and hidden attributes will be applied
  108. to the destination files when they are present in the source files.  Note: 
  109. copying the two hidden system files from a boot drive to another drive will
  110. not necessarily make the destination bootable.  Use the DOS SYS command for
  111. that purpose.
  112.  
  113. /L (Loud) causes extra screen output to be generated, including the names of
  114. all files that are skipped.
  115.  
  116. /N (No overwrite) prevents any destination files from being overwritten,
  117. regardless of the file dates and attributes involved.  The default is to allow
  118. overwrites of destination files with an earlier file date.  This is the
  119. opposite of /O (Overwrite always).
  120.  
  121. /O (Overwrite always) causes destination files to be overwritten regardless of
  122. its file date.  The default is to allow overwrites only of destination files
  123. with an earlier file date.  This is the opposite of /N (No overwrite).
  124.  
  125. /P (Prompt) asks you if you want to copy each file with a Y/n prompt.  "N" or
  126. "n" will cause the file to be skipped.  Most other keys, including "Y" and "y"
  127. will cause the file to be copied.  The "Enter" key need not be pressed after
  128. the "y" or "n".
  129.  
  130. For example,
  131. MCP /P *.* A:
  132. lets you pick exactly which files you want to copy to drive A:, one by one.
  133.  
  134. /Q (Quiet) suppresses all screen output except for error messages and the help
  135. screen in response to a command line error or /?.
  136.  
  137. For example,
  138. MCP /Q /M C:\WORK\*.* F:\MASTER\FRED\
  139. in a network login script would be a subtle way to back up some critical
  140. directory on a users's hard disk to a network directory, where it could be
  141. moved to tape or something.
  142.  
  143. /R (Rename or move) causes files to be renamed if the source and destination
  144. are on the same disk, or copied then the original deleted (after a successful
  145. copy) if the source and destination are on different disks.  If the copy
  146. fails, the original is left intact.  When used with the /S option, emptied
  147. subdirectories are not removed.
  148.  
  149. For example,
  150. MCP C:\STUFF\*.DOC D:\OLDJUNK\ /R
  151. moves every .DOC file in C:\STUFF\ to D:\OLDJUNK\.
  152.  
  153. /S or /E (Subdirectory copy) copies files and subdirectories from the
  154. destination to the source, making subdirectories as needed.  Empty
  155. subdirectories are created as well.  Using /S and/or /E on the command line of
  156. MCP is the same as using both /S and /E on the command line of XCOPY.
  157.  
  158. /V does nothing.
  159.  
  160. /W (Wait) causes the prompt "Press a key when ready to start copy . . ." to be
  161. displayed, and the program to pause until you hit a key before starting the
  162. copy process.  This is for use with floppy only systems, where the MCP command
  163. may reside on a disk other than the one you want do do the copy on.
  164.  
  165. /? (Help) shows the help screen.
  166.  
  167.  
  168. ZERO LENGTH FILES
  169.  
  170. Unlike XCOPY, MCP copies zero length files and, if copying subdirectories,
  171. always copies empty subdirectories.  It also duplicates the file attributes
  172. (system, hidden, read only) of the source file in the destination file, except
  173. for the archive bit, which is always set in the destination file.
  174.  
  175.  
  176. PROMPTS
  177.  
  178. There are several prompts possible in MCP.  At each of the prompts, the
  179. default answer (if applicable) is indicated with a capital letter.  Answers to
  180. the prompts are not case sensitive, and are all only one keystroke.  Pressing
  181. "Enter" after a letter is not required.  The "Enter" key is ignored at all
  182. prompts except for the "Press a key when ready to start copy . . ." prompt
  183. caused by the /W option.  In addition to the listed responses at any prompt,
  184. "Esc", "Ctrl-C", and "Ctrl-Break" will terminate MCP.  "Ctrl-Break" will also
  185. terminate a copy in progress, even if the program is not looking for an answer
  186. to a question.
  187.  
  188.  
  189. filename Y/n?
  190.  
  191. This is the format used in asking if you want to copy a particular file when
  192. you put /P on the command line.  "N" means that you do not want to copy the
  193. file, and most other keys (including "Y") mean that you do want to copy the
  194. file.
  195.  
  196.  
  197. Only 512 bytes available on A:.  filename requires 1234 bytes.
  198. Retry with new disk, Try new disk later, Skip, or Cancel (r/T/s/c)?
  199.  
  200. If your destination is on a fixed disk, press "S" to skip just this file or
  201. "C" to cancel and exit MCP.  If your destination is a removable disk, you may
  202. skip the current file or cancel as with a fixed disk destination.  You may
  203. also wish to change disks and then press "R" to retry copying the current
  204. file, or press "T" to try copying the next file (which may fit) and add the
  205. current file to a list to be tried again later (on a different floppy disk). 
  206. Most other keys act the same as "T".
  207.  
  208.  
  209. No more room on drive A:
  210. Retry with new disk, Skip or Cancel (R/s/c)?
  211.  
  212. Your destination disk has no more room on it.  Change the disk and press "R"
  213. to retry, or "C" to exit the MCP program.
  214.  
  215.  
  216. Error writing to filename.
  217. Retry, Skip, or Cancel (r/S/c)?
  218.  
  219. MCP encountered one of many possible errors (insufficient network rights, bad
  220. disk sectors, hardware failures, disk full even though it had enough room to
  221. start the copy, etc.).  "R" restarts the copy from the beginning of the file. 
  222. "S" skips this file and tries the next.  "C" cancels the copy and exits MCP.
  223.  
  224.  
  225. Does destination specify a File name
  226. or Directory on the target (f=File, D=Directory)? 
  227.  
  228. The destination directory is not an existing directory and the name does not
  229. end with "\", and there may be more than one source file (indicated by wild
  230. cards in the name or a /S or /E switch).  Press "F" if you intended that the
  231. destination is a file name, or "D" if you intended that the destination is a
  232. directory.  If you decide that the command line was in error, press "Esc".
  233.  
  234.  
  235. Press a key when ready to start copy . . .
  236.  
  237. You used the /W option.  Press "Esc", "Ctrl-C", or "Ctrl-Break" if you decide
  238. you really didn't want to copy anything after all, or press any other key to
  239. start the copy process.
  240.  
  241.  
  242. ERROR MESSAGES
  243.  
  244. Break!
  245.  
  246. You pressed Ctrl-Break, Ctrl-C, or Esc to halt the program.
  247.  
  248.  
  249. Unable to create filename
  250.  
  251. The destination file name may have been on an invalid drive, have contained
  252. invalid characters, been in the root directory with all directory entries
  253. filled, been on a network directory with insufficient rights, been too long
  254. for DOS or the network operating system to create, or some other similar
  255. problem.
  256.  
  257.  
  258. Files may not be copied onto themselves.
  259.  
  260. The first step in copying a file is to create a new file of zero length with
  261. name of the destination file.  If the source and destination files are the
  262. same, this action would destroy the source file.
  263.  
  264.  
  265. Destination path is too long.
  266.  
  267. The most likely cause of this error message is starting a recursive copy
  268. command (like MCP /S C:\*.* C:\SUBDIR\).  This causes everything in the root
  269. directory of drive C: to be copied to C:\SUBDIR\ and C:\SUBDIR\SUBDIR\ and
  270. C:\SUBDIR\SUBDIR\SUBDIR\ and so on.  Older versions of XCOPY allow this, the
  271. latest one does not.  MCP allows the recursion to go on until the resulting
  272. path name exceeds DOS limits.  This is a great way to fill up a hard disk in a
  273. hurry.
  274.  
  275.  
  276. Not enough memory to run MCP.EXE
  277.  
  278. Try reducing the number of TSR programs, or if you are shelled out to DOS from
  279. another program, exit that other program.
  280.  
  281.  
  282. Access denied.
  283.  
  284. DOS (or some network software) returned an error code indicating that the
  285. operation was not allowed.  Some things that can do this is trying to create a
  286. directory when a file with the same name already exists or trying to write to
  287. a network directory where you have insufficient rights.
  288.  
  289.  
  290. Bad file number.
  291.  
  292. Something strange is going on that confused DOS and/or MCP -- probably some
  293. error associated with a multitasking environment.
  294.  
  295.  
  296. Attempt to copy more than one file to file.
  297.  
  298. MCP does not concatenate files (use DOS COPY to do that), so copying more than
  299. one file to a single file means that all that ends up in the destination file
  300. is the last file copied.  If this were done with the /R option, all but the
  301. last file would be destroyed.  Therefore, only one file is allowed to be
  302. copied to a file.  The trap that catches this is not foolproof (although it is
  303. reasonably difficult to fool), so you should still take care on the command
  304. line to avoid specifying such an action.
  305.  
  306.  
  307. Unable to open filename
  308.  
  309. The specified file name may not be valid, or may be on a network directory
  310. where you have insufficient rights.
  311.  
  312.  
  313. Ran out of memory keeping track of files to retry.
  314.  
  315. Each file name source and destination that is "remembered" to try later when
  316. you run out of room copying to a diskette takes up some conventional RAM. 
  317. After several thousand of these (more or less, depending on how much RAM you
  318. have available), you may run out.
  319.  
  320.  
  321. ERRORLEVEL
  322.  
  323. When running MCP in a batch file, you can test for the following values of
  324. ERRORLEVEL after MCP runs:
  325.  
  326. 0 = Normal completion.
  327. 2 = "Ctrl-Break", "Ctrl-C", or "Esc" pressed, or copy canceled with "C".
  328. 3 = Unable to write to destination file.
  329. 4 = Attempted to copy file onto itself.
  330. 5 = Destination path is too long.
  331. 6 = Not enough memory to run.
  332. 7 = Access denied.
  333. 8 = Bad file number error returned by DOS.
  334. 9 = Attempt to copy more than one file to one destination file.
  335. 11 = Command line error or help requested.
  336. 12 = Unable to open input file.
  337. 13 = Ran out of memory keeping track of files to retry.
  338.  
  339.  
  340. A COPY PROGRAM BY ANY OTHER NAME
  341.  
  342. MCP comes from M as in Master or Mike's and CP as in the name for the Unix
  343. copy command.  Call it whatever you like, by renaming it, creating an alias
  344. with DOSKEY or a similar utility, or by creating a batch file.  You might want
  345. to create a batch bile called MOVE.BAT (or MV.BAT) that contains the line:
  346.  
  347. MCP /R %1 %2 %3 %4 %5 %6 %7 %8 %9
  348.  
  349.  
  350. LIMITATIONS
  351.  
  352. MCP does not do concatenation.  It does not get the date format from the DOS
  353. country table.  It does not do Japanese dates in year-month-day format.  All
  354. of its error messages are in English.  It does not do a full screen
  355. interface.  It doesn't skip zero length files just because they are zero
  356. length.  It doesn't skip creation of empty subdirectories when /S is used. /V
  357. does absolutely nothing.  It doesn't remove any subdirectories, nor does it
  358. preserve subdirectory attributes (like the hidden bit) when copying
  359. subdirectories.  It doesn't predict winning lottery numbers.  On the other
  360. hand, it does do some things that I always thought that XCOPY should have
  361. done. 
  362.  
  363.  
  364. COPYRIGHT NOTICE & DISCLAIMER
  365.  
  366. Master Copy version 1.03 of 20 September 1992
  367.  
  368. Copyright (C) 1992 Michael Paul Johnson.  All rights reserved.  No warranty.
  369. All trademarks mentioned herein belong to their respective owners.  This is
  370. shareware.  To register, please send $15.00 (or $25.00 if you also want
  371. original disks) to:
  372.  
  373.     Mike Johnson
  374.     PO BOX 1151
  375.     LONGMONT CO 80502-1151
  376.     USA
  377.  
  378. Registration entitles you to support on the Rainbow Missions BBS
  379. (303-938-9654) and by mail, and to notification of major upgrades at discount
  380. rates.
  381.  
  382. Although I try to write perfect software, there is a chance that I goofed up
  383. in some way.  If you find this to be the case, please let me know so that I
  384. can repair it.  Because I can't test every possible use of this software on
  385. every system that it might be run on, and because I have no control over the
  386. way shareware gets passed around, you use this software entirely at your own
  387. risk.  Prices are subject to change without notice.
  388.  
  389.  
  390. HISTORY
  391.  
  392. 1.00  5 Sep 92  Initial release.
  393. 1.01  7 Sep 92  Modified to allow recursive copies of hidden subdirectories.
  394. 1.02  9 Sep 92  Corrected handling of . and .. as source or destination 
  395.                 directory name.
  396. 1.03 20 Sep 92  Added /C switch to specify overwrites of all but identical
  397.                 files.
  398.  
  399.