[<<]Message[>>]    [<<]Author[>>]        Subject        [<<]Thread    

Number : 1396 Date : 2002-01-22 Author : Kan Yabumoto Subject : XXCOPY vs ROBOCOPY, command syntax differences Size(KB) : 3
Hi All: This message is in response to urdbv for his question with regard to his problem in XXCOPY command. Although he did not say anything about his background, I could see his problem is due to the Robocopy/Xcopy syntax. Most people in PC take COPY, and XCOPY for granted. But, we meet younger generations of users who start using Robocopy without going through XCOPY. We are part of the problem. Our tech bulletins implicitly assume some familiarity in XCOPY. I'm thinking of making this text to be a new TB article. ------------------------------------------------------------- While ROBOCOPY and XXCOPY share a lot of similarities one notable difference in these two utilities is in the way the source specifier is treated. Robocopy Syntax: robocopy srcdir destdir [pattern ...] [switches...] Here, filename patterns are listed immediately after the destination directory specifier. If no pattern is given, it assumes everything (*) as the filename pattern. XXCOPY Syntax: xxcopy srcspec destdir [switches...] Here, XXCOPY as an extension of XCOPY, accepts the srcspec as the first argument. Optional /IN switches may be added to provide alternative filename patterns. The striking difference of otherwise very similar two programs is how the source directories and the filename patterns are specified. XCOPY/XXCOPY's srcspec often resembles a full path-specifier of a file, yet it consists of two distinct parts which are magically grafted as one. When you see an XCOPY/XXCOPY srcspec, c:\mydir\xyz, it could actually be one of the two following cases: 1. source directory: c:\mydir\ filename pattern: xyz 2. source directory: c:\mydir\xyz\ filename pattern: * ------------------------------------------------------------ Let me finish my advice by showing the same operation in both ROBOCOPY command and XXCOPY command syntax: Contrast1: robocopy c:\mydir d:\dstdir /mir xxcopy c:\mydir\ d:\dstdir\ /clone Contrast2: robocopy c:\mydir d:\dstdir *.doc *.jpg /s xxcopy c:\mydir\*.doc d:\dstdir\ /in*.jpg /s xxcopy c:\mydir\*.doc /in*.jpg d:\dstdir\ /s xxcopy c:\mydir\nul d:\dstdir\ /in*.doc /in*.jpg /s (The three XXCOPY commands work exactly the same.) Here, note that unlike Robocopy, XXCOPY normally takes the first filename pattern as part of the source specifier. Additional filename patterns are added with the /IN switch. The last example above shows a technique using the special filename "nul" which will include nothing ---letting the /IN switches to add all the filename patterns in /IN switch (more like the way Robocopy works). If you do not add anything in the source specifier, it assumes the template to be for everything (*) (similar to how Robocopy treats when no filename pattern is given). Once you know the small (but enough to fool many) differences in how the two programs accepts the source specifier and the filename pattern, you all feel comfortable with the two utilities which are otherwise designed with very similar viewpoint and goal. Kan Yabumoto