批处理文件以查找文件,然后将其复制粘贴到另一个位置 [英] Batch file to find file, and copy paste it to another location

查看:300
本文介绍了批处理文件以查找文件,然后将其复制粘贴到另一个位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要有关批处理文件的帮助. 我需要的是:查找确切的调用文件(例如,从C:驱动器),然后将其复制粘贴到同一磁盘上的另一个位置.

needing help with batch file. What I need: to find exact called file (for example from C: drive) and copy paste it to another location on same disk.

示例:我需要从C:驱动器中找到名为"textfile.txt"的文件,如果找到它,它将对其进行复制,然后粘贴到位置C:\ Program Files \ Internet Explorer

Example: I need to find file called "textfile.txt" from C: drive, and if it finds it, it will copy it, and paste to location C:\Program Files\Internet Explorer

那么有什么简单的方法吗?

So any simple way to do it?

推荐答案

试一下:

for /f "delims=" %%i in ('dir /s /b /a-d c:\textfile.txt') do copy /b "%%~i" "C:\Program Files\Internet Explorer"

这篇关于批处理文件以查找文件,然后将其复制粘贴到另一个位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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