batch-file File Handling in batch files Copy Files Without xcopy


In this example, user BoeNoe showed how to use the command xcopy to copy files. There is also an extra command called copy.

Here is a simple example:

copy foo.ext bar.ext

This copies foo.ext to bar.ext, and create bar.ext when it doesn't exist. We can also specify paths to the file, but it is always ideal to put quotes (") around paths, see here for the reason.

There are also many flags available for copy, see copy /? or help copy on a command prompt to see more.