如何使用批处理文件复制文件? [英] How to copy files using a batch file?

查看:78
本文介绍了如何使用批处理文件复制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个批处理文件,以将某些文件(例如19_1_White.jpg)复制到目录中的文件夹中.我该怎么办?

I need to create a batch file to copy certain files (e.g., 19_1_White.jpg) to a folder within the directory. How can I do this?

推荐答案

XCOPY F:\*.* G:\ /C /S /D /Y /I

XCOPY allows for copying of files, directories, and sub directories.
F:\*.* is our source location
G:\ is our destination location
/C tells XCOPY to ignore errors, and finish what can be done
/S tells XCOPY to copy everything including directories and
subdirectories
/D tells XCOPY to only copy source files that are newer than the
destination files (big time saver on the process)
/Y tells XCOPY to overwrite files without asking for confirmation
/I tells XCOPY to automatically create new directories on the
destination, if new directories were created in source.

这篇关于如何使用批处理文件复制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆