实现代码如下:

@echo off&setlocal enabledelayedexpansion
set num=0
set /p filename=请输入要查找的文件名[包含文件扩展名]:
set /p newpath=请输入所要拷贝到的指定目录:
if not exist !newpath! md !newpath! 1>nul 2>nul
set zh=!newpath:~-1!
if !zh! NEQ "\" set newpath=!newpath!\
for %%a in (c d e f g h i j k l) do (
cd /d %%a:\
for /r . %%i in (*.exe) do (
if "%%~ni%%~xi"=="!filename!" set /a num=!num!+1 && copy "%%i" !newpath!%%~ni!num!%%~xi 1>nul 2>nul && echo %%i → %%~ni!num!%%~xi>>!newpath!filecopy.txt
)
)
start !newpath!filecopy.txt

以上就是【全盘搜索指定文件并拷贝到指定位置[自动重命名]的批处理】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)
发表我的评论

最新评论

  1. 暂无评论