top of page

XCOPY batch file to copy files


You can write a simple batch file script to copy files from one location to another in this format:

The command XCOPY comes first, followed by the path of the file you want to copy, and then the destination folder you want the files copied to. You can repeat this line of script for as many files as you want to copy.

As explained in past tips on how to use batch files to delete files; and to create folders, when you have the script set up the right way you just need to change the extension to '.bat', and double-click.

The real insider tip here tonight is to avoid the mistake of naming the batch file with the command 'XCOPY'. So when using this script if you click on a file named xcopy.bat instead of the script executing it will get caught in a loop, and nothing will be copied. You'll see this in the command prompt:

Naming the file copy.bat will do the trick.


Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

​

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

​

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page