what switch do you use with xcopy or robocopy to copy subdirectories?

What is Xcopy command?

Xcopy, stands for extended re-create, is a control that can copy multiple files or entire directory copse from ane location to some other. As an advanced version of the copy command, information technology has additional switches to specify both the source and the destination in detail. It is particularly useful when copying files from CDROM to a difficult drive because it will remove the read-only attribute automatically.

Xcopy command is available on nearly operating systems such equally IBM PC DOS, MS-DOS, Windows and freeDOS. While existence functionally replaced by a more powerful copy tool Robocopy, Xcopy is still included in Windows ten, and you tin continue using it to copy folders and subfolders.

Can I re-create folders and subfolders using Xcopy command?

I have a folder with a lot of subfolders and files in them. Now, I want to re-create the folder to another location, but I don't want to recreate directory structures. Can I use Xcopy command to copy the directory structure of the binder and subfolders to another location?

As we know, recreating directory structures can exist a tedious and fault-prone thing, specially if using the right-click method to create multiple structures and folders. So, you may want to re-create folders and subfolders by Xcopy command directly. If you lot don't know how to accomplish it via Xcopy, proceed reading to learn the detailed steps.

*If you want to customize your copy strategy more specifically, or re-create folders while keeping historical versions for data protection purposes, you may consider using advanced method.

xcopy command copy folder sub folder

Copy folders and subfolders using Xcopy control in Windows 7/viii/ten/11

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

xcopy [source] [destination] [options]

And there are plenty of options and switches for different demands. You can copy folders and subfolders including or excluding files from one location to another location by post-obit the steps in different situations.

State of affairs i. re-create folders and subfolders and contents

i. Click Start and blazon cmd in the search box. Right-click Control Prompt from the result listing and select Run every bit ambassador. Or you can press Win + R to call upwards Run window, and type "cmd" in the textbox to directly run information technology.

ii. Now, when y'all're in the Command Prompt, you can type Xcopy command every bit below to copy folders and subfolders including contents. For example, y'all want to re-create "test" folder and its subfolders on C drive to D bulldoze, type Xcopy control as:

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

Xcopy Command

  • /E – Copy subdirectories, including whatsoever empty ones.

  • /H - Copy files with subconscious and system file attributes.

  • /C - Continue copying even if an error occurs.

  • /I - If in doubt, always presume the destination is a folder. eastward.thou. when the destination does not exist.

Notes:

  • Xcopy will not copy open files.

  • Xcopy doesn't display whatever progress or completed operations data when executed.

  • Recollect that for folders with spaces in the proper name or folders larger than eight characters in length, it is a good idea to put quotation marks around the path as in the effigy in a higher place or yous may get an fault.

Situation 2. copy folders and subfolders without files

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

Xcopy Source Destination /T /Eastward

  • /T - Copy the subdirectory structure, only not the files.

  • /E - Copy subdirectories, including any empty ones.

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

Sometimes, you may need to transfer the NTFS and Share permission together with your folders.

One time the Command Prompt is open, y'all can and then type the following Xcopy command to copy all files and folders and retain its NTFS and Share permissions.

Xcopy Source Destination /O /10 /Eastward /H /Thousand

  • /East - Copy folders and subfolders, including empty ones.

  • /H - Copy hidden and organisation files likewise.

  • /K - Re-create attributes. Typically, Xcopy resets read-only attributes.

  • /O - Copy file ownership and ACL data.

  • /X - Copy file inspect settings (implies /O).

Really, in that location are many parameters of Xcopy command, and you tin combine different parameters for different situations. But if at that place is a slight fault in the command, the copy operation may fail, and fifty-fifty 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 control line, and want to copy files and folders easily, you tin also employ a handy backup software.

Advanced way to re-create files or folders in Windows 7/8/10/eleven flexibly

Xcopy essentially duplicates your folders to create an intact re-create, and although information technology has some optional parameters, it is notwithstanding difficult to exercise some avant-garde operations or requires carefully written syntax.

For example, you may desire to auto re-create inverse files to target directory, keep different versions of backups for accurate recovery, compress fill-in files to save storage space, etc. In these cases, AOMEI Backupper Standard is a gratuitous and reliable option for PCs running Windows 11/x/eight.ane/eight/seven/Vista/XP.

Re-create options: It enables you lot to sync folders with original format & construction for straight use, or backup folders into image files in case of recovery needs.
Storage devices: Information technology supports internal/external drive, USB flash drive, cloud, network share and NAS every bit target or destination storage.
Schedule options: Information technology contains scheduled options to automate backup/sync task on regular basis, and you tin can perform incremental or differential backup to support only inverse data.
What's more than: If you want to auto sync inverse files from source to target in real fourth dimension, or auto delete older versions of backups to relieve space, you lot tin upgrade to Professional person edition.

Stride past step guide to copy files or folders via AOMEI Backupper

i. Download AOMEI Backupper Standard, install and launch it.

2. To re-create folders with original format & structure, simply selectSync > Basic Sync. If you desire to fill-in folders into restorable epitome files, however, you lot can considerBackup options, which are better suited for bankroll up big information (similar partitions, disks, system fill-in), or keeping different backup versions.

basic sync

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

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

Add Folder

Note: Afterwards clicking Add Folder, you can open Filter Settings to set up file inclusion/exclusion mask (bachelor in Pro and above editions).

Filter Settings

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

Select Destination

5. (Optional) Click ScheduleSync to enable it, and gear up a Daily/Weekly/Monthly task as you similar.

Schedule Settings General

6. Confirm all your settings and clickStart Sync.

Verdict

You can copy folders and subfolders using Xcopy control by the steps shown to a higher place. All the same, many users say that copying failed due to Xcopy not working sometimes, or Xcopy does non copy all files. And in some cases, Xcopy halts considering of "Insufficient Memory" mistake or invalid number of parameters.

Therefore, using AOMEI Backupper to copy folders or files is a more than reliable and user-friendly method. With just a few clicks, you tin can re-create folders or files to your destination, and its useful features similar incremental backup, USB plug in, etc. bring y'all much convenience.

If you want to fill-in files on whatsoever other computers without installation, use AOMEI Backupper Technician or Technician Plus to create a portable AOMEI Backupper. Only give it a shot!

lesterelike1943.blogspot.com

Source: https://www.ubackup.com/backup-restore/xcopy-command-to-copy-folders-and-subfolders-6688.html

0 Response to "what switch do you use with xcopy or robocopy to copy subdirectories?"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel