home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / MCP120.ZIP / MCP.TXT < prev    next >
Text File  |  1993-10-02  |  23KB  |  630 lines

  1. Master Copy (MCP.EXE)
  2.  
  3. The Better XCOPY
  4.  
  5. Version 1.20
  6.  
  7. October 2, 1993
  8.  
  9. (C) 1993 Michael Paul Johnson
  10.  
  11. INTRODUCTION
  12.  
  13. MCP (Master Copy) is kind of like XCOPY, but it normally only 
  14. overwrites older files and it can move files.  It was written 
  15. primarily for use in keeping directory structures shared by 
  16. different people (or by the same person on different computers) 
  17. in synchronization with each other.  It is also a quick way to 
  18. implement disk mirroring style backups.
  19.  
  20. If you have a PostScript printer, you can print this document by 
  21. copying MCP.PS to it.  If not, use MCP.TXT.
  22.  
  23. RUNNING MCP
  24.  
  25. MCP is a DOS command line utility with a syntax that is an 
  26. extension of the XCOPY that comes with DOS:
  27.  
  28. MCP source [destination] [switches]
  29.  
  30. Switches can be:
  31.  
  32. /A = copy only files with Archive bit set (leave source archive 
  33. bit set).
  34.  
  35. /B = ask permission Before overwriting each existing destination 
  36. file.
  37.  
  38. /C = Copy & overwrite all files except those with identical 
  39. date, time & size.
  40.  
  41. /D = copy files with Date the same or later than Date given 
  42. /D:mm-dd-yyyy /D:dd.mm.yyyy /Dmm/dd/yy or /Ddd.mm.yy.
  43.  
  44. /F = Force overwrite of system, hidden, and read only files.
  45.  
  46. /H = Copy system and Hidden files as well.
  47.  
  48. /I = Inhibit actual copy.  Tests what MCP would do.
  49.  
  50. /J = Just copy files that already exist in destination 
  51. directory.
  52.  
  53. /L = List lots of loud verbose output (for troubleshooting).
  54.  
  55. /M = copy only files with archive bit set (Modify source archive 
  56. bit).
  57.  
  58. /N = No overwrite.
  59.  
  60. /O = Overwrite destination files.
  61.  
  62. /P = Prompt before copy.
  63.  
  64. /Q = Quiet (report only errors).
  65.  
  66. /R = Rename or move files.
  67.  
  68. /S = /E = recurse through Subdirectories (& create Empty ones).
  69.  
  70. /T = Stop Twirling "propeller" (useful for redirection).
  71.  
  72. /U = Update (overwrite only older files -- the default mode).
  73.  
  74. /V = This switch doesn't cause an error message, but it doesn't 
  75. do anything. It is included so that batch files written for 
  76. XCOPY can use MCP with the same switches.  (/V turns verify on 
  77. in XCOPY).  To turn on verify, use the DOS command VERIFY ON 
  78. before using MCP.
  79.  
  80. /W = Wait for keystroke before starting copy
  81.  
  82. /? = Show help screen.
  83.  
  84. On the command line, source is a file name or directory name, 
  85. which may optionally include drive and path.  It may also 
  86. include DOS wild cards ? and *.  If the source is a drive or 
  87. directory, the file specification *.* is assumed.
  88.  
  89. The destination is a file name or directory.  If no destination 
  90. is specified, the current directory is assumed.  If there are 
  91. wild card characters in the destination file name, they will be 
  92. filled in with the corresponding characters in the source file 
  93. name.  If it is not obvious if the destination is a file or 
  94. directory, you may be asked which you meant.  To ensure that the 
  95. destination is interpreted as a directory instead of a file, end 
  96. the directory name in "\" or ensure that the destination 
  97. directory already exists.  If the destination directory does not 
  98. exist, it will be created.
  99.  
  100. Switches all start with "/" (not "-", since - is a valid file 
  101. name character in DOS), and may be before, between, and/or after 
  102. the source and destination.  Switches may be combined.  In case 
  103. of a conflict between switches, the one that is farthest to the 
  104. right on the command line takes precedence.  For brevity, 
  105. command line switches may be run together after a single "/".  
  106. Switches are not case sensitive.
  107.  
  108. /A (Archive) and /M (Modify archive) both specify that only 
  109. files that have the DOS directory archive bit set (indicating 
  110. that they have been changed since they were last backed up) 
  111. should be copied.  /A does not alter the archive bit on the 
  112. source file. /M clears the archive bit of the source file to 
  113. indicate that it has been backed up.  The archive bit of the 
  114. destination file is always set when using MCP.  These options 
  115. can be used for backing up data when the largest file you want 
  116. to back up will fit on your destination media.  If the largest 
  117. file you want to back up is bigger, a regular backup program is 
  118. more appropriate than MCP.
  119.  
  120.  However, for some small but important files, backing up with a 
  121. copy command like MCP makes more sense, because the file itself 
  122. is not altered, making restoration possible even without the 
  123. original backup program.
  124.  
  125. For example, 
  126.  
  127. MCP /A C:\WORK\DOC\*.* A:
  128.  
  129. copies all files in C:\WORK\DOC to the floppy disk in A: that 
  130. have not been marked as backed up.
  131.  
  132. /B (ask Before overwrite) causes MCP to stop and ask if you want 
  133. to copy each file for which the destination file already 
  134. exists.
  135.  
  136. /C (Copy & overwrite all but identical date, time & size) will 
  137. cause all destination files with the same name but different 
  138. (older or newer) date & time or different size (smaller or 
  139. larger) to be overwritten.
  140.  
  141. /D (Date) is always followed by a date, with no space in between 
  142. the /D and the date.  The colon following the D is optional.  
  143. The order of the date is month day year if you use "/" or "-" to 
  144. separate the numbers in the date.  If you use "." to separate 
  145. the numbers in the date, the order is day month year.  The year 
  146. can be specified with either the last two digits or all four 
  147. digits. If you specify the last two digits, the year is assumed 
  148. to be in the range 1980 through 2079.  The month must be 
  149. expressed as a number between 1 and 12.  Leading zeros on month 
  150. and day are optional.
  151.  
  152. For example, the following commands all copy everything with a 
  153. file date on or after December 25, 1991 from the current 
  154. directory to D:\SAVE\.
  155.  
  156. MCP /D12/25/91 *.* D:\SAVE\
  157.  
  158. MCP /D:12/25/91 *.* D:\SAVE\
  159.  
  160. MCP *.* D:\SAVE\ /D12/25/1991
  161.  
  162. MCP /D12-25-91 *.* D:\SAVE\
  163.  
  164. MCP *.* /D12-25-1991 D:\SAVE\
  165.  
  166. MCP /D25.12.91 *.* D:\SAVE\
  167.  
  168. MCP /D:25.12.1991 *.* D:\SAVE\
  169.  
  170. /F Forces overwriting of Hidden, System, and Read Only files.  
  171. WARNING:  use this option with caution.  It is very useful for 
  172. some situations, but could have some undesired side effects if 
  173. you overwrite some files of this type.
  174.  
  175. /H (Hidden & system) allows files with the system and hidden 
  176. attribute to be copied.  Note that the XCOPY that comes with 
  177. MS-DOS 5.0 and MS-DOS 6.0 will not copy hidden files, but 
  178. earlier versions will.  The system and hidden attributes will be 
  179. applied to the destination files when they are present in the 
  180. source files.  Note:  copying the two hidden system files from a 
  181. boot drive to another drive will not necessarily make the 
  182. destination bootable.  Use the DOS SYS command for that 
  183. purpose.
  184.  
  185. /J (Just existing) causes only those files that already exist in 
  186. the destination directory to be copied over (and then only if 
  187. they are older, the /o switch is used, or the /b switch is used 
  188. and you answer Y for yes).
  189.  
  190. /L (Loud) causes extra screen output to be generated, including 
  191. the names of all files that are skipped.
  192.  
  193. /N (No overwrite) prevents any destination files from being 
  194. overwritten, regardless of the file dates and attributes 
  195. involved.  The default is to allow overwrites of destination 
  196. files with an earlier file date.  This is the opposite of /O 
  197. (Overwrite always).
  198.  
  199. /O (Overwrite always) causes destination files to be overwritten 
  200. regardless of its file date.  The default is to allow overwrites 
  201. only of destination files with an earlier file date.  This is 
  202. the opposite of /N (No overwrite).
  203.  
  204. /P (Prompt) asks you if you want to copy each file with a Y/n 
  205. prompt.  "N" or "n" will cause the file to be skipped.  Most 
  206. other keys, including "Y" and "y" will cause the file to be 
  207. copied.  The "Enter" key need not be pressed after the "y" or 
  208. "n".
  209.  
  210. For example,
  211.  
  212. MCP /P *.* A:
  213.  
  214. lets you pick exactly which files you want to copy to drive A:, 
  215. one by one.
  216.  
  217. /Q (Quiet) suppresses all screen output except for error 
  218. messages and the help screen in response to a command line error 
  219. or /?.
  220.  
  221. For example,
  222.  
  223. MCP /Q /M C:\WORK\*.* F:\MASTER\FRED\
  224.  
  225. in a network login script would be a subtle way to back up some 
  226. critical directory on a user's hard disk to a network directory, 
  227. where it could be moved to tape or something.
  228.  
  229. /R (Rename or move) causes files to be renamed if the source and 
  230. destination are on the same disk, or copied then the original 
  231. deleted (after a successful copy) if the source and destination 
  232. are on different disks.  If the copy fails, the original is left 
  233. intact.  When used with the /S option, emptied subdirectories 
  234. are not removed.
  235.  
  236. For example,
  237.  
  238. MCP C:\STUFF\*.DOC D:\OLDJUNK\ /R
  239.  
  240. moves every .DOC file in C:\STUFF\ to D:\OLDJUNK\.
  241.  
  242. /S or /E (Subdirectory copy) copies files and subdirectories 
  243. from the destination to the source, making subdirectories as 
  244. needed. Empty subdirectories are created as well.  Using /S 
  245. and/or /E on the command line of MCP is the same as using both 
  246. /S and /E on the command line of XCOPY.
  247.  
  248. /U (Update) overrides a previous /o, /b, or /n on the command 
  249. line and returns MCP to its default handling of existing 
  250. destination files (overwrite them only if they are older).
  251.  
  252. /V does nothing.  To turn verify on, use the command VERIFY ON 
  253. before running MCP.
  254.  
  255. /W (Wait) causes the prompt "Press a key when ready to start 
  256. copy..." to be displayed, and the program to pause until you hit 
  257. a key before starting the copy process.  This is for use with 
  258. floppy only systems, where the MCP command may reside on a disk 
  259. other than the one you want to do the copy on.
  260.  
  261. /? (Help) shows the help screen.
  262.  
  263. MOVING FILES
  264.  
  265. Since moving files is a fairly common operation, you may want to 
  266. define a doskey alias to move files (DOSKEY MV=MCP /R $*) or use 
  267. the MV.BAT batch file.  If you are using a version of DOS prior 
  268. to 3.3, delete the @ from the beginning of the MCP command.  
  269. This command lets you move files safely.  Note that the original 
  270. file will not be deleted if it is marked as "system" or "read 
  271. only."  Note also that when moving entire directory structures, 
  272. source subdirectories are not deleted.  To delete entire 
  273. directory structures or to delete system or read only files, you 
  274. can use the DELETE command (also written by Mike Johnson).
  275.  
  276. ZERO LENGTH FILES
  277.  
  278. Unlike XCOPY, MCP copies zero length files and, if copying 
  279. subdirectories, always copies empty subdirectories.  It also 
  280. duplicates the file attributes (system, hidden, read only) of 
  281. the source file in the destination file, except for the archive 
  282. bit, which is always set in the destination file.
  283.  
  284. PROMPTS
  285.  
  286. There are several prompts possible in MCP.  At each of the 
  287. prompts, the default answer (if applicable) is indicated with a 
  288. capital letter.  Answers to the prompts are not case sensitive, 
  289. and are all only one keystroke.  Pressing "Enter" after a letter 
  290. is not required.  The "Enter" key is ignored at all prompts 
  291. except for the "Press a key when ready to start copy . . ." 
  292. prompt caused by the /W option.  In addition to the listed 
  293. responses at any prompt, "Esc", "Ctrl-C", and "Ctrl-Break" will 
  294. terminate MCP.  "Ctrl-Break" will also terminate a copy in 
  295. progress, even if the program is not looking for an answer to a 
  296. question.
  297.  
  298. filename Y/n?
  299.  
  300. This is the format used in asking if you want to copy a 
  301. particular file when you put /P on the command line.  "N" means 
  302. that you do not want to copy the file, and most other keys 
  303. (including "Y") mean that you do want to copy the file.
  304.  
  305. Only 512 bytes available on A:.  filename requires 1234 bytes. 
  306. Retry with new disk, Try new disk later, Skip, or Cancel 
  307. (r/T/s/c)?
  308.  
  309. If your destination is on a fixed disk, press "S" to skip just 
  310. this file or "C" to cancel and exit MCP.  If your destination is 
  311. a removable disk, you may skip the current file or cancel as 
  312. with a fixed disk destination.  You may also wish to change 
  313. disks and then press "R" to retry copying the current file, or 
  314. press "T" to try copying the next file (which may fit) and add 
  315. the current file to a list to be tried again later (on a 
  316. different floppy disk).  Most other keys act the same as "T".
  317.  
  318. No more room on drive A:
  319.  
  320. Retry with new disk, Skip or Cancel (R/s/c)?
  321.  
  322. Your destination disk has no more room on it.  Change the disk 
  323. and press "R" to retry, or "C" to exit the MCP program.
  324.  
  325. Error writing to filename.
  326.  
  327. Retry, Skip, or Cancel (r/S/c)?
  328.  
  329. MCP encountered one of many possible errors (insufficient 
  330. network rights, bad disk sectors, hardware failures, disk full 
  331. even though it had enough room to start the copy, etc.).  "R" 
  332. restarts the copy from the beginning of the file.  "S" skips 
  333. this file and tries the next.  "C" cancels the copy and exits 
  334. MCP.
  335.  
  336. Does destination specify a File name
  337.  
  338. or Directory on the target (f=File, D=Directory)?
  339.  
  340. The destination directory is not an existing directory and the 
  341. name does not end with "\", and there may be more than one 
  342. source file (indicated by wild cards in the name or a /S or /E 
  343. switch). Press "F" if you intended that the destination is a 
  344. file name, or "D" if you intended that the destination is a 
  345. directory.  If you decide that the command line was in error, 
  346. press "Esc".
  347.  
  348. Press a key when ready to start copy . . .
  349.  
  350. You used the /W option.  Press "Esc", "Ctrl-C", or "Ctrl-Break" 
  351. if you decide you really didn't want to copy anything after all, 
  352. or press any other key to start the copy process.
  353.  
  354. ERROR MESSAGES
  355.  
  356. No matching files found.
  357.  
  358. No files matching the file specification you provided were found 
  359. to copy.  Check the spelling of your source file(s), the 
  360. existence of those files, and the network rights pertaining to 
  361. those files.
  362.  
  363. Break!
  364.  
  365. You pressed Ctrl-Break, Ctrl-C, or Esc to halt the program.
  366.  
  367. Unable to create filename
  368.  
  369. The destination file name may have been on an invalid drive, 
  370. have contained invalid characters, been in the root directory 
  371. with all directory entries filled, been on a network directory 
  372. with insufficient rights, been too long for DOS or the network 
  373. operating system to create, or some other similar problem.
  374.  
  375. Files may not be copied onto themselves.
  376.  
  377. The first step in copying a file is to create a new file of zero 
  378. length with name of the destination file.  If the source and 
  379. destination files are the same, this action would destroy the 
  380. source file.  It is also possible to get this error message when 
  381. the source or destination drive is invalid.
  382.  
  383. Destination path is too long.
  384.  
  385. The most likely cause of this error message is starting a 
  386. recursive copy command (like MCP /S C:\*.* C:\SUBDIR\).  This 
  387. causes everything in the root directory of drive C: to be copied 
  388. to C:\SUBDIR\ and C:\SUBDIR\SUBDIR\ and C:\SUBDIR\SUBDIR\SUBDIR\ 
  389. and so on.  Older versions of XCOPY allow this, the latest one 
  390. does not.  MCP allows the recursion to go on until the resulting 
  391. path name exceeds DOS limits.  This is a great way to fill up a 
  392. hard disk in a hurry.
  393.  
  394. Not enough memory to run MCP.EXE
  395.  
  396. Try reducing the number of TSR programs, or if you are shelled 
  397. out to DOS from another program, exit that other program.
  398.  
  399. Access denied.
  400.  
  401. DOS (or some network software) returned an error code indicating 
  402. that the operation was not allowed.  Some things that can do 
  403. this is trying to create a directory when a file with the same 
  404. name already exists or trying to write to a network directory 
  405. where you have insufficient rights.
  406.  
  407. Bad file number.
  408.  
  409. Something strange is going on that confused DOS and/or MCP, 
  410. probably some error associated with a multitasking environment.
  411.  
  412. Attempt to copy more than one file to file.
  413.  
  414. MCP does not concatenate files (use DOS COPY to do that), so 
  415. copying more than one file to a single file means that all that 
  416. ends up in the destination file is the last file copied.  If 
  417. this were done with the /R option, all but the last file would 
  418. be destroyed.  Therefore, only one file is allowed to be copied 
  419. to a file.  The trap that catches this is not foolproof 
  420. (although it is reasonably difficult to fool), so you should 
  421. still take care on the command line to avoid specifying such an 
  422. action.
  423.  
  424. Unable to open filename
  425.  
  426. The specified file name may not be valid, or may be on a network 
  427. directory where you have insufficient rights.
  428.  
  429. Ran out of memory keeping track of files to retry.
  430.  
  431. Each file name source and destination that is "remembered" to 
  432. try later when you run out of room copying to a diskette takes 
  433. up some conventional RAM.  After several thousand of these (more 
  434. or less, depending on how much RAM you have available), you may 
  435. run out.
  436.  
  437. ERRORLEVEL
  438.  
  439. When running MCP in a batch file, you can test for the following 
  440. values of ERRORLEVEL after MCP runs:
  441.  
  442. 0 = Normal completion.
  443.  
  444. 1 = No matching files found to copy.
  445.  
  446. 2 = "Ctrl-Break", "Ctrl-C", or "Esc" pressed, or copy canceled 
  447. with "C".
  448.  
  449. 3 = Unable to write to destination file.
  450.  
  451. 4 = Attempted to copy file onto itself.
  452.  
  453. 5 = Destination path is too long.
  454.  
  455. 6 = Not enough memory to run.
  456.  
  457. 7 = Access denied.
  458.  
  459. 8 = Bad file number error returned by DOS.
  460.  
  461. 9 = Attempt to copy more than one file to one destination file.
  462.  
  463. 11 = Command line error or help requested.
  464.  
  465. 12 = Unable to open input file.
  466.  
  467. 13 = Ran out of memory keeping track of files to retry.
  468.  
  469. NAME TRIVIA
  470.  
  471. MCP comes from M as in Master or Mike's and CP as in the name 
  472. for the UNIX copy command.  Call it whatever you like, by 
  473. renaming it, creating an alias with DOSKEY or a similar utility, 
  474. or by creating a batch file.
  475.  
  476. LIMITATIONS
  477.  
  478. MCP does not do concatenation.  It does not get the date format 
  479. from the DOS country table.  It does not do Japanese dates in 
  480. year-month-day format.  All of its error messages are in 
  481. English. It does not do a full screen interface.  It doesn't 
  482. skip zero length files just because they are zero length.  It 
  483. doesn't skip creation of empty subdirectories when /S is used. 
  484. /V does absolutely nothing (use the DOS command VERIFY ON before 
  485. MCP for the same effect).  It doesn't remove any subdirectories, 
  486. nor does it preserve subdirectory attributes (like the hidden 
  487. bit) when copying subdirectories.  It does not copy to devices 
  488. like LPT1 or PRN.  It cannot copy from defective disk media.  It 
  489. doesn't predict winning lottery numbers.  On the other hand, it 
  490. does do some things that I always thought that XCOPY should have 
  491. done. 
  492.  
  493. LEGAL NOTICES
  494.  
  495. Copyright (C) 1992-1993 Michael Paul Johnson.  All rights 
  496. reserved.  No warranty. All trademarks mentioned herein belong 
  497. to their respective owners.  This is shareware.  To register, 
  498. please send $15.00 (or $25.00 if you also want original disks & 
  499. printed documentation; $100 for site license for unlimited use 
  500. within one corporation) to:
  501.  
  502.         Mike Johnson
  503.         PO BOX 1151
  504.         LONGMONT CO 80502-1151
  505.         USA
  506.  
  507. Registration entitles you to support on the Rainbow Missions BBS 
  508. (303-938-9654) and by mail, and to notification of major 
  509. upgrades at discount rates.  Minor upgrades (like 1.04 to 1.05) 
  510. are free for the downloading from the Rainbow Missions BBS, or 
  511. available to registered users on disk for $10.
  512.  
  513. Although I try to write perfect software, there is a chance that 
  514. I goofed up in some way.  If you find this to be the case, 
  515. please let me know so that I can repair it.  Because I can't 
  516. test every possible use of this software on every system that it 
  517. might be run on, and because I have no control over the way 
  518. shareware gets passed around, you use this software entirely at 
  519. your own risk. Prices are subject to change without notice.
  520.  
  521. HOW TO CONTACT THE AUTHOR
  522.  
  523. 1.  Leave a message at the Rainbow Missions BBS, 303-938-9654. 
  524. The latest version of this software will be posted there, as 
  525. well.
  526.  
  527. 2.  Write to Mike Johnson, PO Box 1151, Longmont CO 80502-1151, 
  528. USA.
  529.  
  530. 3.  Send electronic mail to CompuServe ID 71331,2332 or Internet 
  531. address mpj@csn.org.
  532.  
  533. 4.  Call Mike Johnson at home at 303-772-1773.
  534.  
  535. VERSION HISTORY
  536.  
  537. 1.00  5 Sep 92  Initial release.
  538.  
  539. 1.01  7 Sep 92  Modified to allow recursive copies of hidden 
  540. subdirectories.
  541.  
  542. 1.02  9 Sep 92  Corrected handling of . and .. as source or 
  543. destination directory name.
  544.  
  545. 1.03 20 Sep 92  Added /C switch to specify overwrites of all but 
  546. identical files.
  547.  
  548. 1.04 22 Sep 92  Added /B switch to allow individual prompts for 
  549. overwrites.
  550.  
  551. 1.05  5 Oct 92  Improved safety feature that prevents copying or 
  552. renaming more than one file to the same destination file. Added 
  553. /J switch to allow selective copying only of files that already 
  554. exist in the destination directory.
  555.  
  556. 1.06 11 Dec 92  Added /T switch for better results with 
  557. redirected output.
  558.  
  559. 1.07 14 Dec 92  Corrected command line scanning error that 
  560. sometimes caused /D switch to be falsely rejected.
  561.  
  562. 1.08  6 Feb 93  Increased depth of recursion possible for better 
  563. network compatibility.
  564.  
  565. 1.09 31 May 93  Corrected action with /P and /R when moving to a 
  566. destination on the same volume.
  567.  
  568. 1.10  3 Jul 93  Added warning message and ERRORLEVEL 1 exit if 
  569. no source files match the specification on the command line.
  570.  
  571. 1.20  2 Oct 93  Added /I switch.
  572.  
  573. INVOICE
  574.  
  575. Remit to:                                       Ship to:
  576.  
  577. Mike Johnson                            
  578. ________________________________
  579.  
  580. PO Box 1151                             
  581. ________________________________
  582.  
  583. Longmont CO 80502-1151          
  584. ________________________________
  585.  
  586.                                                 
  587. ________________________________
  588.  
  589.                                                 Contact person:
  590.  
  591.                                                 
  592. ________________________________
  593.  
  594.                                                 
  595. ________________________________
  596.  
  597. Quantity        Description                                     
  598. Unit Price      Total
  599.  
  600.                         MCP registration with disk
  601.  
  602. ________                & printed documentation.        $25.00  
  603. ______
  604.  
  605.                         MCP single copy registration
  606.  
  607. ________                only.                                   
  608. $15.00  ______
  609.  
  610.                         Site license for unlimited use
  611.  
  612.                         of MCP at one corporation
  613.  
  614.                         (includes one disk & one
  615.  
  616. ________                printed manual).                        
  617. $100.00 ______
  618.  
  619.                                                                  
  620. Total   ______
  621.  
  622. I prefer        5.25"____   3.5"____  disks.
  623.  
  624. Note that the MCP software has been delivered and accepted by 
  625. the customer.  Upon receipt of this paid invoice, the printed 
  626. documentation and disks paid for will be sent.
  627.  
  628. MCP 1.20                Page 
  629.  
  630.