Xcopy Command In Windows Server 2008

In this article I am going to explain about Xcopy Command in Windows Server 2008 operating system and also explain it's related syntax.
  • 5576

Introduction

In this we Copies files and directories, including subdirectories.

Syntax

 

Xcopy <Source> [<Destination>] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/g] [/d [:MM-DD-YYYY]] [/u] [/i] [/s [/e]] [/t] [/k] [/r] [/h] [{/a | /m}] [/n] [/o] [/x] [/exclude:FileName1[+[FileName2]][+[FileName3]] [{/y | /-y}] [/z] [/b] [/j]

 

 Parameter  Description
<Source> It specifies the location and names of the files you want to copy.
[<Destination>] In this we specifies the destination of the files you want to copy.
/w In this we displays the following message and waits for your response before starting to copy files:
/p In this prompts you to confirm whether you want to create each destination file.
/c Ignores errors.
/v It verifies each file as it is written to the destination file to make sure that the destination files are identical to the source files.
/q It suppresses the display of xcopy messages.
/f In this we displays source and destination file names while copying.
/l It displays a list of files that are to be copied.
/g It creates decrypted Destination files when the destination does not support encryption.
/d [:MM-DD-YYYY] It copies source files changed on or after the specified date only.
/u It copies files from Source that exist on Destination only.
/i If Source is a directory or contains wildcards and Destination does not exist, xcopy assumes Destination specifies a directory name and creates a new directory.
/s It copies directories and subdirectories, unless they are empty.
/e In this copies all subdirectories, even if they are empty.
/t It copies the subdirectory structure (that is, the tree) only, not files.
/k It copies files and retains the read-only attribute on Destination files if present on the Source files.
/r Copies read-only files.
/h Copies files with hidden and system file attributes.
/a Copies only Source files that have their archive file attributes set.
/m Copies Source files that have their archive file attributes set.
/n Creates copies by using the NTFS short file or directory names.
/o Copies file ownership and discretionary access control list (DACL) information.
/x Copies file audit settings and system access control list (SACL) information
/exclude:FileName1[+[FileName2][+[FileName3](…)] It specifies a list of files. At least one file must be specified. Each file will contain search strings with each string on a separate line in the file.
/y It suppresses prompting to confirm that you want to overwrite an existing destination file.
/-y This Prompts to confirm that we  want to overwrite an existing destination file.
/z It copies over a network in restartable mode.
/b In this we copies the symbolic link instead of the files.
/j In this copies files without buffering. Recommended for very large files.
/? It displays help at the command prompt.

Example

xcopy \rawdata \reports /u

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.