Page 1 of 1

Batch File Help

Posted: Sun May 06, 2007 12:11 am
by Kills On Site
I am trying to write a batch file that will copy files from one location to another. The files will be overwriting files in the destination. Everything I try seems to not work. Any ideas?

Posted: Sun May 06, 2007 12:16 am
by Foo
You need some xcopy loving.

Give us the source and target folder names and we can write you a 1-line batch to do it. Unless its hideously complex.

Posted: Sun May 06, 2007 12:25 am
by Kills On Site
Well due to the sensitivity of the files, I can't divulge their true names and locations.

G:\file1.ext and G:\file2.ext need to both go to C:\Program Files\Program\Information\

I use quotations around the files and tried /Y, and /V, but they wont overwrite the file1 and file2 already in the Information folder.

The files from G: also need to be deleted after trasfer, but I can just use del G:\file1.ext

Posted: Sun May 06, 2007 12:32 am
by Foo
/R /Y and instead of using copy use xcopy.

That should fix it.

Y suppresses overwrite warnings.
R writes over read-only files.

Posted: Sun May 06, 2007 12:37 am
by Kills On Site
Foo, you are the batch god, you know that. Thanks for your help.

Posted: Sun May 06, 2007 12:39 am
by Foo
lies, I learned from guys with beards longer than my arm :D

Anytime.