Documente Academic
Documente Profesional
Documente Cultură
pdf
Saved to Dropbox • May 12, 2019 at 12B34 AM
Home
What is XXCOPY ? [ Table of Contents ] [ Show as Detached ] [ >> ]
Products
Downloads XXCOPY TECHNICAL BULLETIN #001
FAQ
Order From: Kan Yabumoto tech@xxcopy.com
To: XXCOPY user
Support
Subject: XXCOPY Command Parameters Reference
About Us (Pixelab)
Date: 2010-01-01 Revised for ver 3.00.0
On-Line Manual ===============================================================================
XXTB #001
XXTB #002 Basic Command Parameter Syntax:
XXTB #003
XXCOPY source destination (simplified syntax)
XXTB #004
XXTB #005 In its simplest form, XXCOPY takes two parameters,
...
from WHERE to WHERE
This very intuitive command syntax has its root in the COPY command
introduced in 1981 as a PC-DOS (MS-DOS) built-in command.
XXCOPY
The first parameter is the source specifier and the second one is
Version
the destination specifier. These two parameters must be in this
3.33.3 order. As commonly done in the COPY and XCOPY command syntax, the
destination specifier can be omitted. Then, by default, the
current directory in the current drive becomes the destination.
All switches start with a slash (/) character whereas the source
and the destination specifiers do not have the slash(/) prefix.
The source and the destination specifiers must be separated from
other items in the command line by at least one blank (space or tab)
character. On the other hand, you may omit blank characters between
switches in order to minimize the total length of the command line.
Example:
Note that the positions of the switches need not be at the end of
the command line. Switches may begin even before the source specifier.
The order of the switches is not generally important with the exception
of when conflicting switches are specified, in which case the rightmost
switch will prevail. More rules for special cases are discussed at
the end of this article. For a complete review of syntax and semantics
for the source specifier, see XXTB #04.
-------------------------------------------------------------
Caution to DOS novices:
Let us take a look at the full list of XXCOPY switches; each switch
contains a terse comment. For most switches, full explanation will
be given later.
----- The following switches use file attributes to select files -----
/A Same as /ATA. Copies only files with the archive attribute set.
Doesn't change the attribute.
/M Copies only files with the archive attribute set.
Turns off the archive attribute.
/AT<mask> Selects files by the attribute bits (ACHSR).
You may use two or more /AT<mask> switches to specify multiple
required attributes. E.g., /ATA/ATH qualifies files with both
the A(rchive) bit and the H(idden) bits.
Alternatively, you may use one /AT<mask> switch with multiple letters
to select alternative attribute bits to select files. E.g.,
/ATAH qualifies a file which has either A-bit, H-bit or both.
/AX<mask> Excludes files with the specified attribute bits (ACHSR).
You may use two or more /AX<mask> switches to specify
attribute bits to exclude files for file operations. E.g.,
/AXA/AXH excludes files with A-bit, H-bit, or both.
Or, you may use one /AX<mask> switch with multiple letters to
exclude files with only the specified combination of attribute
bits. E.g., /AXAH excludes files with both A-bit and H-bit.
/AA Sets the src file archive bit (without actually copying).
/AZ Clears the src file archive bit (without actually copying).
Note: Both /AA and /AZ implicitly set /H (can be overridden).
/AC Copies specified files irrespective of the archive attribute.
Turns off the archive attribute after XXCOPY is done.
/AN<mask> Sets a new value to file attribute bits (replace the value).
The <mask> value is a combination of letters, ACHSR.
/AR<mask> Resets file attribute bits (clears specified bits).
/AS<mask> Sets file attribute bits (sets specified bits).
Note: The <mask> value for /AR and /AS specifies attributes (ACHSR)
whose bits are either reset or set respectively to the existing
file attributes. Unspecified attributes bits are kept unchanged.
Note: The /AA, /AN, /AR, /AS, /ARD, /ASD, and /AZ switches modify the
file attributes without copying the files to the destination,
whereas the /A, /AT and /AX switches select files by the file
attributes for various operations (copy, list, remove, etc.).
----- The following switches use other file attribute bits -----
----- The following switches controls the compression on file copy -----
/KCFP Sets dst file's C-bit with that of its parent dir (default).";
/KCFD Keeps dst file's C-bit, a new file gets its parent's C-bit.";
/KCFS Sets dst file's C-bit with that of src file's C-bit.";
/KCFC Always sets the C-bit of dst file (compress).";
/KCFU Always resets the C-bit of dst file (uncompress).";
/KCDP Sets dst dir's C-bit with that of its parent dir (default).";
/KCDD Keeps dst dir's C-bit, a new dir gets its parent's C-bit.";
/KCDS Sets dst dir's C-bit with that of src dir's C-bit.";
/KCDC Always sets the C-bit of dst directory (compress).";
/KCDU Always resets the C-bit of dst directory (uncompress).";
----- The following switches are useful for backup and archive -----
/SP Spans the copy job over multiple destination (new volume).
----- The following switches are shortcuts for popular operations -----
Note: Both the /BACKUP and /CLONE operations copy the contents of the
source directory into the destination directory incrementally
(only those files with the timestamp and/or the filesize changed).
The /CLONE operation differs from the /BACKUP operation by deleting
extra files and directories in the destination directory (whose
counterpart in the source no longer exists). This makes /CLONE
considerably more dangerous than /BACKUP.
<xspec> Exclusion item for /X and the file contents specified by /EX.
. The text file may contain an arbitrary number of xspecs which
are separated by space, tab, or newline characters.
. An xspec with embedded spaces must be surrounded by a pair
of double-quote characters(").
. An xspec cannot span from one line to another.
. Two consecutive colons (::) or slashes (//) start a comment
field which ends at the end of the line.
. You may specify more than 1 exclusion file. In such a
case all of the exclusion files will be processed.
/D Same as /DA.
/DA Copies newer files and brand new files.
/DB Copies older files and brand new files.
/DS Copies only the files whose filetime is exactly the same.
/DX Copies only the files whose filetime is different in any way.
Note: All filetime comparisons are affected by the fuzzy range (/FF).
Note: With /DA#<val>, /DB#<val> and /Do#<val>, the parameter <val> will
be treated as the number of Days unless it is appended with a
one-letter suffix (D, H, M, or S which stand for Days, Hours,
Minutes, or Seconds, respectively). When <val> is given in
the number of days, the exact time is midnight of the day.
e.g., /DA#0 denotes files made some time today after midnight.
/Do#2 means all day the day before yesterday.
/DA#30m selects files made within the last 30 minutes.
/DA:. Copies files that were changed today or later (same as /DA#0).
/DB:. Copies files that were changed yesterday or earlier.
/Do:. Copies files that were changed today only.
The <time> parameter starts with the <date> (as shown above)
followed by 'T' or '@' and hh:mm:ss, hh:mm, or hh.
Note: /DA, /DB, /DX, /DS, /Do, /DA:<date> and /DB:<date> are mutually
exclusive (except /DA:<date> and /DB:<date> work as a pair).
Note: /DA and /DB, if date is omitted, are the same as /BN and /Bo,
respectively, except that /DA and /DB can be combined with another
/Bxx switch (e.g., /BI) where as /BN and /Bo cannot (in the same group).
Note: /DA, /DB, /DX and /DS compare source and destination files using
both date and time whereas /DA:<date> and /DA#<n> use date only.
/FW Uses the Last-Write timestamp for the Filetime comparison (default).
/FA Uses the Last-Access timestamp for the Filetime comparison.
/FC Uses the Creation timestamp for the Filetime comparison.
Note: With /FF<val>, /FF+<val> and /FF-<val>, the parameter <val> will
be treated as the number of seconds unless it is appended with a
one-letter suffix (D, H, M, or S which stand for Days Hours,
Minutes, or Seconds, respectively).
e.g., /FF treats file times within +/- 2 sec as the same.
/FF-1H treats files older by up to 1 hour as the same.
/FF+2/FF-4 (you may choose asymmetric slack values).
Note: The /FF switch affects all filetime comparisons such as /CLONE,
/BI, /BU, /BS, /BX, /BO, /BN, /DA, /DB, /DS, /DX, /TS, and /TD.
/TS+<n> Adds an offset (Hr) to the time of source (and the copied ) file.
/TS-<n> Subtracts an offset (Hr) from source (and the copied) file.
/TD+<n> Adds an offset (Hr) to the time of the destination file.
/TD-<n> Subtracts an offset (Hr) from the dst file for comparison.
Note: The offset value <n> for /TS and /TD is specified in hours
unless it is appended with a one-letter suffix (D, H, M, or S
which stand for Days, Hours, Minutes, or Seconds respectively).
Note: The size values <n> and <m> are entered in bytes unless appended
with a suffix letter (K, M, or G which stands for metric kilo
(x1000), mega (x1000000), or giga (x1000000000) respectively).
----- The following switch limits the destination file size -----
Note: /SGL and /SGLo is works well with other file-selection switches.
E.g., /SGLo /BZL to gather the largest file of its kind.
/SL, /SX, and /SR are the same as /S except the output files
will be saved as a flat directory without adding levels of
subdirectories. The source subdirectory name will become a
part of the target filename. /SL and /SR add the subdir name
to the left or right of the name respectively.
/SX inserts the subdirectory name in the middle.
/SLR /SXR, and /SRR do opposite of /SL, /SX and /SR respectively.
/S<d> Sets the directory delimiter character for /SL, /SX and /SR,
where <d> is any legal non-alphabetic, non-blank character.
The default delimiter is back-apostrophe (`).
----- The following switches controls the maximum path length -----
/I If the destination does not exist and you are copying more
than one file, this switch assumes that the destination must
be a directory (no prompting).
Note: when the destination specifier ends with a backslash, it
declares itself as a directory which implicitly sets the /I switch.
/IA Continues if destination is absent (terminates if it exists).
/IA<item> Continues if the specified item (file/directory) is absent.
/IP Continues if destination is present (terminates if absent).
/IP<item> Continues if the specified item (file/directory) is present.
/ILD<label> Continues if the destination volume label matches as specified.
/ILS<label> Continues if the source volume label matches as specified.
/ZB<n> Sets the size of the file copy buffer (in bytes).
/ZB0 Cancels the buffer size setting (uses the default size).
----- The following switches are for safe file overwrite -----
/W Same as /WS.
/WS Prompts you to press a key at the start of copying.
/WS<n> Waits at the start of operation for a specified period (n sec).
/WE Prompts you to press a key at the end of copying.
/WE<n> Waits at the end of the operation for a specified period (n sec).
/WD0 Suppresses warning for copying a non-directory source.
/WD Prompts with a warning for copying a non-directory src (default).
/WL Issues a warning when the path length exceeds the limit (default).
/WL0 Suppresses warning for the path length exceeds the limit.
/WN Displays a warning on failure on SFN-preservation in file copy.
/WN0 Suppresses warning on failure on SFN-preservation in file copy.
/WU<n> Prompts with a warning for unneccary destination (default).
/WU0<n> Suppresses warning for unnecessary destination specifier.
/WV0 This switch is now obsolete and has no effect.
/WV This switch is now obsolete and has no effect.
Note: Whereas /Y and /-Y modify prompting for the copy action
of /RC (Remove after Copy) switch, the suffix 'P' or 'Y' controls
the prompt for the file remove action after copy.
Note: The suffix 'P' or 'Y' can also be added to any of /RS, /RD,
or /RX switches which will insert or suppress respective prompt.
For these remove-without-copy switches, the /Y and /-Y switches
also control the prompt for the remove action.
Note: /RX can be thought of a /Z operation without copying files.";
In general, the /RS/BB combination (by swapping src and dst)";
provides more file-selection controls than the /RX switch.";
/MVD Moves directories (the src and dst must be in the same volume).
/MVF Moves files (the src and dst must be in the same volume).
/MVX Moves files, if fails then tries /RC (remove-after-copy).
/N Uses the short (8.3) name for name matching, and creation.
/N0 Disables /N and /NP (default, uses longname when applicable).
/NP Uses precise name matching (default, ignores match in alias).
/NP0 Uses loose name matching (longname or shortname match).
/NX Preserves the shortname when the file is copied.
/NX0 Disables the /NX (shortname preservation) feature.
Note: If src and dst are both local drive, the shortname will be
preserved (/NX) by default, but if either src or dst is
specified by a UNC (starts with \\), /NX0 is default.
/QF Quits when the quota for the file count has been reached.
/QBL Quits before the byte count exceeds the limit (same as /QB).
/QBT Quits when the total byte count reaches the trigger point.
/QSL Quits before the space dips below the limit (same as /QS).
/QST Quits when the remaining space reaches the trigger point.
/NI Becomes nice to other tasks by idling (1000 msec) between actions.
/NI<n> Same as /NI. Specifies n msec as the idle time (0 to disable it).
/L Same as /LLZ which performs the list operation (no file copy).
/L<items> Customizes the format for List operation (no file copy).
<items> is a string of one or more of the following letters
which selects the combination and the output order.
D file date
T file time
H history (creation, last-write, last-access timestamps)
Z file size in bytes
A file attributes: A(rchive),H(idden),S(system),R(eadonly)
S short name (8.3)
N long name (lastname) without path
L long name with full directory path
P parent path name without the lastname
R long relative (below base directory) name
, comma as a separator (for a CSV format output)
D file date
T file time
H history (creation, last-write, last-access timestamps)
Z file size in bytes
A file attributes: A(rchive),H(idden),S(system),R(eadonly)
S short name (8.3)
N long name (lastname) without path
L long name with full directory path
P parent path name without the lastname
R long relative (below base directory) name
, comma as a separator (for a CSV format output)
Note: /SC and /SF work only when src and dst are both NTFS.
----- The following switches control junctions and symbolic links -----
----- The following switches control hard links and symbolic links -----
/MLH Makes a hard link file in dst for each file in the src.
/ULH Unlinks hard link files into regular (non hard link) files.
The screen and the log file output can be fine tuned by the followng:
0: No output
1: Screen only
2: Log file only
3: Screen and Log file both
/$xxxx$ Pre-defined macros for current date and time which may appear
anywhere in the command argument and other XXCOPY parameters.
Examples below are for the current time, Dec 25, 2002 13:15:30
/$DATE$ Expands to month and date (equivalent to /$MMDD$) --> "1225".
/$TIME$ Expands to hour and minutes (equiv. /$HHNN$) --> "1315".
/$YYMMDD$ Expands to 2-digit year month day --> "021225".
/$YYYY-MM$ Expands to 4-digit year month --> "2002-12".
/$YY-M-D$ Expands to 2-digityear-mo-dy (mo and dy without leading zero).
/$HHNNSS$ Expands to hour minutes second --> "131530".
/$MON-DD$ Expands to month day --> "DEC-25".
/$WWW$ Expands to day of the week --> "WED".
/$W$ Expands to ordinal number of day of the week --> "3".
/$II-IWK-K$ Expands to the ISO 8601 year-week --> "02-W52-3".
/$HOSTS$ Expands to the name of the host (curren) computer.
Note: The offset value <n> for /TM+ and /TM- is specified in days
unless it is appended with a one-letter suffix (D, H, M, or S
which stand for Days, Hours, Minutes, or Seconds respectively).
Note: all the variations in the backup switches (/Bx) include the files in A
with the exception of /BS to be consistent with the spirit of BACKUP.
As shown in the example (/U/BI), adding /U eliminates the files in A.
/RS files in A and/or B that satisfy other specified switches (for remove).
/RC same as /RS (for remove-after-copy).
/RD (none in D) files in C that would be overwritten (for remove).
/RX all files in D (for remove).
Note: /BS for copy usually accomplishes nothing but is useful as /RS/BS.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Source Specifier:
xxcopy c:\mydir\*.doc
xxcopy "c:\program files\mydir\myfile.doc"
xxcopy \\myserver\drivec\config.sys
Here, the three parts in the source specifiers are quite obvious. In
the second example, the double-quotes (") allow XXCOPY to treat the
entire command argument as one source specifier. Without the double-
quotes, the embedded space character would make it two parameters
volume_spec
base_dir
The name of the source directory. When the XXCOPY command
contains the subdirectory switch (/S and/or /E), the base_dir
specifier denotes the starting directory where the source
files and subdirectories are located. The base_dir part
must not contain wild card characters.
pattern
The last part within the source specifier denotes the pattern
matching string which may contain wildcard characters (* or ?).
It matches only the last components within a full filename.
You may omit any of the three parts, but you may need something
as the source specifier as the space holder so that you can specify
the destination specifier as the second non-switch argument. In
this case, you may use "." which denotes the current directory
as the source.
When you omit either the base_dir part or the pattern part,
that is, when a source specifier without a backslash separating the
two parts, the exact meaning of the command become ambiguous.
We will discuss the source specifier ambiguity in a later
article.
Destination Specifier:
[ volume_spec ] [ dest_dir ]
volume_spec
dest_dir
XXCOPY does not rename files while they are copied. therefore,
no wildcard characters have no place in dest_dir.
XXCOPY's command switches always start with a slash (/) as the only
legitimate prefix (the Unix-style hyphen (-) is not recognized as
a switch prefix).