Xcopy command to copy data from one drive to another
Xcopy is a built-in command on Windows OS like Windows 10, 8, 7 and more. Compared with old basic copy command, Xcopy has added some new and advanced features. For example, it can copy directories, copy all files including subdirectories recursively and can replicate the source directory structure from one drive to another. To copy contents from one drive to another on a Windows PC, firstly, open up the command prompt (Windows key + R then type cmd), secondly, run the following command:
“xcopy d:\ e:\ /h/i/c/k/e/r/y”
The above command copies all of the files on the d:\ drive to the e:\ drive. There are many options specified here (the letters with a slash before them). Here's what the parameters are doing:
d:\-- is the source drive you are cloning. e:\--is the destination drive you are cloning to. /h – copy hidden and system files/folders. /i – if in doubt always assume the destination is a folder e.g. when the destination does not exist. /c – continue copying even if an error occurs. /k –keep read-only attribute. With this option, read-only files will retain the read-only file attribute after copy. /e –copy all directories, even if they are empty. /r – overwrite read-only files in destination. /y –assume yes to all overwrites.
Xcopy not working in Windows 10
Although Xcopy commands can copy a drive and all inside content to another drive, it is a file/folder level copy rather than a partition/drive level copy. Besides, an error might occur when you copy content between two different file systems-e.g. from an NTFS drive to a FAT32 drive; therefore you need to ensure the source and destination drive are using the same file system. Moreover, some PC users complain that Xcopy does not working in Windows 10:
“I am trying to run xcopy but it returns the ‘invalid number of parameters’. The command is ‘xcopy C:\Users\User1\Downloads\Surface RT 8.0 Recovery.ISO:\*.* /s/e/f/h F:\’. Maybe I have to abandon this command, so is there another way to do what I want to accomplish? Thanks,”
In such issues, an alternative to Xcopy command will be required to clone a drive/partition content to another location flexibly.
What’s the best Xcopy alternative in Windows 11,10, 8,7?
When Xcopy command does not work to copy content from one partition to another in your situation, the free partition manager –AOMEI Partition Assistant Standard can be a great alternative. It works well on both 32-bit and 64-bit Windows 10/8/7 and Windows XP/Vista. As a perfect alternative to Xcopy command, it is able to clone partition, clone disk, clone OS effectively. With a user-friendly and intuitive main interface, you can easily finish every steps of cloning a partition/disk. Besides, you will have two different clone methods to choose:
1. Clone Partition Quickly (file by file): only copies all existing files from the source partition to the destination disk. 2. Sector-by-Sector Clone (complete copy): copies both existing files and lost/deleted files to the destination disk.
Tutorial: clone partition with Xcopy alternative in Windows 10
Now, you can free download the software and learn how to clone a partition in Windows 10 (as an example).
Make sure there is an unallocated space on the destination disk to hold the source partition; otherwise you will need to shrink an existing partition to generate such space.
The unallocated space should be equal or larger than the used space of the source partition for “Clone Partition Quickly”. And it must be equal or larger then the all space of the source partition for “Sector-by-Sector Clone”.
You can close all running programs on the partition you will clone, or this operation will be executed under PreOS mode.
Step 1. Install and launch AOMEI Partition Assistant Standard. Right-click the source partition and select “Clone Partition”.
Step 2. Choose a proper clone method based on your situation and click “OK”. Here we select the first method.
Step 3. Select an unallocated space and then click "Next" to continue.
Note: If you are copying partition to SSD drive, you can tick the option "Optimize the performance of SSD" to align SSD partitions.
Step 4. Here you can adjust partition size as you like, or keep the default settings and click "Finish".
Step 5. Back to the main interface, you can preview the clone result. To make it take effect, click “Apply” and “Proceed”.
After clone is done, everything including programs will be on the destination partition and they can work as normal. If you want to wipe everything from the old partition to prevent data leakage, you can try the "Wipe Partition" function provided by AOMEI Partition Assistant Standard.
If you plan to clone system drive, the “Migrate OS to SSD Wizard” is a better choice. It allows you to migrate only operating system to another disk.
As seen above, AOMEI Partition Assistant Standard is a great Xcopy alternative in Windows 10/8/7 when the Xcopy does not work as expected. Apart from partition/disk/system clone function, this versatile software also does well in converting disk between MBR and GPT without deleting partitions, merging partitions, checking partition for bad sectors, rebuilding MBR, etc. For Windows Server 2019/2016/2012/2008/2003 users, AOMEI Partition Assistant Server is highly recommended.