How to Copy Folders and Subfolders Using Xcopy Command  

How to Copy Folders and Subfolders Using Xcopy Command


Table of Contents
  1. What is Xcopy command
  2. Can I copy folders and subfolders using Xcopy command?
  3. Copy folders using Xcopy command in Windows 11/10/8/7
    1. Situation 1. copy folders and subfolders and contents
    2. Situation 2. copy folders and subfolders without files
    3. Situation 3. copy folders and subfolders with NTFS and Share permission
  4. Advanced | copy files or folders in Windows flexibly
    1. Step by step guide to copy files or folders via Qiling Disk Master
  5. Verdict

What is Xcopy command

The Xcopy command is an advanced version of the standard "copy" function within Windows environments; it's particularly useful when you need to replicate multiple files or entire directory structures from one location to another. With additional switches available (beyond those found in regular copying operations), users can specify source and destination parameters with more precision.

Xcopy command is available on most operating systems such as IBM PC DOS, MS-DOS, Windows and freeDOS. While being functionally replaced by a more powerful copy tool Robocopy, Xcopy is still included in Windows 10, and you can continue using it to copy folders and subfolders.

xcopy command copy folder sub folder

Can I copy folders and subfolders using Xcopy command?

You're looking for an efficient way to replicate folder structures without having them recreated manually, but rather through use of the Xcopy command or another tool suited towards such tasks.

You're looking for an easier method to replicate entire folders along with their contents without having to manually reconstruct each one using traditional right-click methods or other manual processes that involve recreating multiple directories step by step.

If you don't know how to achieve it via Xcopy, keep reading to learn the detailed steps.

Better way to copy any files & folders

Customizing file and folder duplication approaches within Windows environments often necessitates the use of specialized utilities like Robocopy which supports mirroring directory trees as well as preserving previous states of files. This can be particularly useful in scenarios requiring high-level version control or ensuring that historical versions remain intact for data protection purposes. and advanced method »

Copy folders using Xcopy command in Windows 11/10/8/7

To move folders and subfolders in cmd, the most used command syntax would be:

xcopy [source] [destination] [options]

For replicating entire directory structures with their contents across different locations within Windows environments, the Xcopy command offers various options and switches tailored to meet specific requirements. Depending on the situation, users can choose whether they want to include files in addition to subdirectories or exclude them altogether when copying from one location to another.

Situation 1. copy folders and subfolders and contents

1. Click Start and type cmd in the search box. Right-click Command Prompt from the result list and select Run as administrator. Or you can press Win + R to call up Run window, and type "cmd" in the textbox to directly run it.

2. Now, when you're in the Command Prompt, you can type Xcopy command as below to copy folders and subfolders including contents. For example, you want to copy "test" folder and its subfolders on C drive to D drive, type Xcopy command as:

Xcopy C:\test D:\test /E /H /C /I

Xcopy Command

Notes:

Situation 2. copy folders and subfolders without files

You can open the Command Prompt according to the steps shown above. Then, type the Xcopy command as below to copy folders and subfolders without files:

Xcopy Source Destination /T /E

Situation 3. copy folders and subfolders with NTFS and Share permission

In situations where NTFS and share permissions need to be transferred along with entire folder structures during replication tasks within Windows environments, consider using utilities specifically designed to handle these operations. These tools can ensure that all necessary rights are preserved as folders are duplicated.

Once Command Prompt is launched, users can proceed by typing an Xcopy command tailored specifically towards retaining NTFS permissions along with share settings during replication operations. This ensures the preservation of file system rights as directories are duplicated across different locations within Windows.

Xcopy Source Destination /O /X /E /H /K

Actually, there are many parameters of Xcopy command, and you can combine different parameters for different situations. But if there is a slight error in the command, the copy operation may fail, and even lead to data loss. Therefore, you must be very careful when using Xcopy command.

For users who are not familiar with the use of the command line, and want to copy files and folders easily, you can also use a handy backup software.

Advanced | copy files or folders in Windows flexibly

Xcopy provides a basic folder duplication, but for advanced operations like auto-copying changed files, versioning, and compression, Qiling Disk Master Standard is a reliable free option for Windows PCs.

Copy options: It enables you to sync folders with original format & structure for direct use, or backup folders into image files in case of recovery needs.
Storage devices: It supports internal/external drive, USB flash drive, cloud, network share and NAS as target or destination storage.
Schedule options: It contains scheduled options to automate backup/sync task on regular basis, and you can perform incremental or differential backup to back up only changed data.
What's more: If you want to auto sync changed files from source to target in real time, or auto delete older versions of backups to save space, you can upgrade to Professional edition.

Step by step guide to copy files or folders via Qiling Disk Master

1. Download free Qiling Disk Master Standard, install and launch it.

2. To copy folders with original format & structure, just select Backup and recovery> File Sync.

If you want to backup folders into restorable image files, you can consider Backup options, which are better suited for backing up large data (like partitions, disks, system backup), or keeping different backup versions.

basic sync

In advanced edition, you can enjoy 3 more practical sync modes:
Real-Time Sync: Sync changed files from source directory to target directory in real time.
Mirror Sync: Keep the contents in target directory exactly the same as the source directory.
Two-Way Sync: Make any changes in source or target directory be synced to the other side mutually.

3. Click Add Folder to specify the folder and click OK. You can add more folders by clicking the + button.

Add Folder

Note: When replicating folder structures or selecting specific file types within Windows environments using utilities like Robocopy for advanced version control purposes, users may choose to filter content based on certain criteria. This could include setting up inclusion/exclusion masks that dictate which files are included in the replication process.

File Filter

4. Select the destination path you want to copy files to. Internal hard drive, connected external hard drive, cloud drive, shared folder, and NAS are all available.

Select Destination

5. (Optional) Click Schedule Sync to enable it, and set a Daily/Weekly/Monthly task as you like.

Schedule Settings General

6. Confirm all your settings and click Proceed.

Tips:

Verdict

You can copy folders and subfolders using Xcopy command by the steps shown above. However, many users say that copying failed due to Xcopy not working sometimes, or Xcopy does not copy all files. And in some cases, Xcopy halts because of "Insufficient Memory" error or invalid number of parameters.

Therefore, using Qiling Disk Master to copy folders or files is a more reliable and convenient method. With only a few clicks, you can copy folders or files to your destination, and its useful features like incremental backup, USB plug in, etc. bring you much convenience.

If you want to backup files on any other computers without installation, use Qiling Disk Master Technician or Technician Plus to create a portable Qiling Disk Master. Just give it a shot!

Related Articles


Is this information helpful?     

What can we do to improve this information? (Optional)
Refresh Please enter the verification code!