# Solved: How to create a batch file to copy files



## brainwave89 (Aug 6, 2007)

Thank you for looking.

How do you create a batch file that will copy files from a sub-folder in Program Files to a folder in My Documents?

It also needs to overwrite the files that currently exist in the folder in My Documents.

This will be done on a Windows XP Professional OS.

Thanks!


----------



## Squashman (Apr 4, 2003)

You use the /Y switch with the copy command.

copy /Y "C:\Program File\SomeDirectory\*.*" "C:\Documents and Settings\Username\My Documents"


----------



## brainwave89 (Aug 6, 2007)

Thanks Squashman!

The following worked:
copy /y "c:\program files\folder\*.* "c:\docume~!\username\mydocu~1\folder"

Cheers!


----------



## Squashman (Apr 4, 2003)

Why are you using the Short file names?


----------

