tags:

views:

7678

answers:

3

I have two code bases of an application. I need to copy all the files in all the directories with .java from the newer code base, to the older (so I can commit it to svn).

How can I write a batch files to do this?

+5  A: 

XCOPY /D ?

xcopy c:\olddir\*.java c:\newdir /D /E /Q /Y
Danimal
+1  A: 

If you've lots of different instances of this problem to solve, I've had some success with Apache Ant for this kind of copy/update/backup kind of thing.

There is a bit of a learning curve, though, and it does require you to have a Java runtime environment installed.

Brent.Longborough
A: 

I like Robocopy ("Robust File Copy"). It is a command-line directory replication command. It was available as part of the Windows Resource Kit, and is introduced as a standard feature of Windows Vista and Windows Server 2008.

Mackaaij