The robocopy command is also similar but has even more options.

The availability of certain xcopy command switches and other command syntax may differ from operating system to operating system.

Xcopy Backup Script

In this example, xcopy is designed to function as a backup solution.

Person using XCopy command

Miguel Co / Lifewire

Try this if you’d like to use xcopy instead of abackup software programto back up your files.

Put the command as shown above in a script and schedule it to run nightly.

Save the sometimes lengthy output of the xcopy command to a file using aredirection operator.

Learnhow to redirect command output to a fileor check out our list ofCommand Prompt Tricksfor more tips.

However, the latter command was never intended to be run directly.

When you execute xcopy, you’re always running the most appropriate version of the command.

This command is also very much like the robocopy command except that robocopy has more flexibility than even xcopy.

Robocopy supports different switches for copying files across anetwork.