繁体   English   中英

如何制作一个bat文件来查找文件路径并将特定文件复制到其他位置

[英]How to make a bat file which find a file path and copy a specific file to an other location

我想制作一个蝙蝠文件,该文件将首先在路径中搜索可执行文件“ Text.exe”。 然后我想复制从我创办的路径log.log文件,在文件夹THR日志和这个文件复制到服务器\\ server1的\\日志文件

你能帮我一个例子吗?

其中c:\\searchlocation是您要搜索的路径:

FOR /F "tokens=*" %%F IN ('dir /b /s C:\searchlocation\Text.exe') do (
    copy "%%~pFLog.log" "\server1\logFiles"
)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM