Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam

 <  Day Day Up  >  

Using XCOPY / XCOPY32

The XCOPY command can be used in place of COPY in most cases and has the following advantages:

  • Faster operation on a group of files ” XCOPY reads the specified files into conventional RAM before copying them to their destination.

  • Creates folders as needed ” Specify the destination folder name in the XCOPY command line, and the destination folder will be created if needed.

  • Operates as backup utility ” Can be used to change the archive bit from on to off on XCOPY ed files if desired to allow XCOPY to be used in place of commercial backup programs.

  • Copies files changed or created on or after a specified date ” Also useful when using XCOPY as a substitute for commercial backup programs.

If XCOPY is run from a command-prompt window (the Windows 9x/Me GUI is active), many additional options are available because XCOPY will launch XCOPY32 .

The following XCOPY options apply when the Windows 9x/Me GUI is not active (for example, when you boot directly to a command prompt with an EBD):

A:\XCOPY.EXE/? Copies files (except hidden and system files) and directory trees. XCOPY source [destination] [/A /M] [/D:date] [/P] [/S [/E]] [/V] [/W] source Specifies the file(s) to copy. destination Specifies the location and/or name of new files. /A Copies files with the archive attribute set, doesn't change the attribute. /M Copies files with the archive attribute set, turns off the archive attribute. /D:date Copies files changed on or after the specified date. /P Prompts you before creating each destination file. /S Copies directories and subdirectories except empty ones. /E Copies any subdirectories, even if empty. /V Verifies each new file. /W Prompts you to press a key before copying.

Here are some examples:

  • XCOPY *.txt A:\TEXT\ ” Copies all .txt files in the current folder to the \TEXT folder on drive A:; creates folder if needed.

  • XCOPY *.txt /d:01-01-01 \TEXT\ ” Copies all .txt files in the current folder that were created on or after 01-01-01 to the \TEXT folder on the current drive; creates folder if needed.

  • XCOPY *.DOC /S/E F:\ ” Copies all .doc files in the current folder and folders below the current one to the root folder of drive F: and duplicates the folder structure below the current folder on F:.

When XCOPY is run within the Windows 9x/Me GUI, it launches XCOPY32 . The following are XCOPY32 's options:

C:\Windows\Desktop>XCOPY32/? Copies files and directory trees. XCOPY source [destination] [/A /M] [/D[:date]] [/P] [/S [/E]] [/W] [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U] [/K] [/N] source Specifies the file(s) to copy. destination Specifies the location and/or name of new files. /A Copies files with the archive attribute set, doesn't change the attribute. /M Copies files with the archive attribute set, turns off the archive attribute. /D:date Copies files changed on or after the specified date. If no date is given, copies only those files whose source time is newer than the destination time. /P Prompts you before creating each destination file. /S Copies directories and subdirectories except empty ones. /E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T. /W Prompts you to press a key before copying. /C Continues copying even if errors occur. /I If destination does not exist and copying more than one file, assumes that destination must be a directory. /Q Does not display filenames while copying. /F Displays full source and destination filenames while copying. /L Displays files that would be copied. /H Copies hidden and system files also. /R Overwrites read-only files. /T Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories. /U Updates the files that already exist in destination. /K Copies attributes. Normal XCOPY will reset read-only attributes. /Y Overwrites existing files without prompting. /-Y Prompts you before overwriting existing files. /N Copy using the generated short names.

The options for Windows NT/2000/XP's XCOPY are identical to those used for Windows 9x's XCOPY32 , and the following options also apply:

  • /O ” Copies file ownership and ACL information.

  • /X ” Copies file audit settings.

  • /Z ” Copies network files in restartable mode.

In Windows 9x/Me, XCOPY32 has the following advantages over XCOPY :

  • Copies file attributes without resetting them

  • Can copy system and hidden files

  • Automatically creates a destination folder when copying multiple files to a specified location

  • Optional file overwrite protection

XCOPY32 can be used to "clone" an entire drive's contents to another drive. For example, the following copies the entire contents of C: drive to D: drive:

XCOPY32 C:\. D:\ /H /S /E /K /C /R

 <  Day Day Up  >  

Категории