[英]Batch file to copy files from one directory to another
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).
我需要将.java中所有目录中的所有文件从较新的代码库复制到较旧的代码(以便将其提交到svn)。
How can I write a batch files to do this? 我该如何编写批处理文件?
XCOPY / D?
xcopy c:\olddir\*.java c:\newdir /D /E /Q /Y
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. 如果您要解决此问题的许多不同实例,那么在使用Apache Ant进行此类复制/更新/备份方面已经取得了一些成功。
There is a bit of a learning curve, though, and it does require you to have a Java runtime environment installed. 有一个学习曲线,虽然, 它需要你有安装了Java运行时环境。
I like Robocopy ("Robust File Copy"). 我喜欢Robocopy (“鲁棒文件复制”)。 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.
它作为Windows资源工具包的一部分提供,并作为Windows Vista和Windows Server 2008的标准功能引入。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.