简体   繁体   English

批处理文件可将文件从一个目录复制到另一个目录

[英]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.

相关问题 如何在批处理文件中将选定的文件从一个文件夹复制到另一个文件夹? - How to copy selected files from one folder to another in Batch file? 将目录文件复制到批处理文件中的另一个目录,而无需询问? - Copy Directory files to another directory in batch file without asking? 批处理文件 将具有特定扩展名的文件从多个目录复制到一个目录中 - batch file Copy files with certain extensions from multiple directories into one directory 尝试使用批处理将文件从当前目录复制到另一个目录 - Trying to copy files from current directory to another with batch 批处理文件将文件夹从文本文件复制到另一个目录 - Batch File to copy folders from a text file to another directory 批处理文件将超过30分钟的文件从一个文件夹复制到另一个文件夹 - batch file to copy files older than 30 minutes from one folder to another 如何在批处理文件中复制特定文件的目录 - how to copy directory of specific files in batch file 在PowerShell中递归地将一组文件从一个目录复制到另一个目录 - Recursively copy a set of files from one directory to another in PowerShell 将元数据从一个文件批量复制到另一个文件(EXIFTOOL) - Batch copy metadata from one file to another (EXIFTOOL) 从批处理文件的目录中复制文件 - Copy file from batch file's directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM