![Xcopy Vista Switches Xcopy Vista Switches](https://fthmb.tqn.com/VWp3cbQhhOw3dB17V5Zj86FjuAM=/735x0/about/vol-command-windows-10-57267a0a3df78ced1fe61320.png)
Syntax of Xcopy command. Xcopy has a large number of possible switches, which gives the command a great deal of flexibility. The syntax for the command is given by.
- Applies To: Windows Server 2003, Windows Vista, Windows XP, Windows Server 2008, Windows 7, Windows Server 2003 R2, Windows.
- To copy entire directory structures as quickly as possible and ignore all disk errors (useful in data recovery) either of the following commands should work.
- The xcopy command is used to copy files from one place to another. It is available from the Command Prompt and MS-DOS.
Xcopy command : syntax and examples. What’s Xcopy? Xcopy is a built in command on Windows OS. But it does not work for copying directories. It would not copy files from sub directories.
![Xcopy Vista Switches Xcopy Vista Switches](http://www.xxcopy.com/img/xx_shot.gif)
Adding /I switch will avoid the question to the user . It also creates the same directory/file structure in the destination folder.
If the destination folder already exists you do not need to add /I switch. If the folder does not exist and you do not specify /I you will be prompted to confirm if the destination is a filer or folder. This would cause issues if you want to run unattended or automated copying of files. Copy files including hidden and system files. The above command excludes hidden and system files from copying.
If you want to these files also then you need to add /H option to your command. Then the command would be. Xcopy /S /I /E /H D: \data\documents E: \Newfolder\documents/E option causes to copy empty sub directories to the destination folder. If you add /H option the the command would also copy hidden and system files to the destination folder. If you are trying to overwrite an existing file then add the option /Y so that you will not be prompted for confirmation for overwriting the file. Copy files based on archive attribute.
If you want to copy only the files that have archive attribute set, you can use /A and /M switches. Archive attribute indicates whether the file has been modified since the time the attribute was reset. The command for this is: Xcopy /A /I /S source. The command for this case would be: Xcopy /M /I /S source. Each file name/pattern should be in a separate line. The commands shown above can be used from batch files also.
Robocopy, or "Robust File Copy", is a command-line directory and/or file replication command. Robocopy functionally replaces Xcopy, with more options.
![Xcopy Vista Switches Xcopy Vista Switches](https://image.slidesharecdn.com/batch-file-programming-120519004129-phpapp02/95/batch-file-programming-73-728.jpg?cb=1337388323)
![Xcopy Vista Switches Xcopy Vista Switches](https://tr1.cbsistatic.com/hub/i/2009/12/19/1c1f8c95-c3b3-11e2-bc00-02911874f8c8/xcopy_tool_fig_b.png)
![Xcopy Vista Switches Xcopy Vista Switches](http://www.masterstationlog.com/msl/images/backup_01.png)
This command is available in Windows 7, XP, Vista, Server 2. Server 2. 00. 8 editions. Copy files based on modified date. Xcopy /D: dd- mm- yy /I sourcedir destinationdir.
Example: To copy all the files in the directory.