echo off
:continue
set /p FileName=请输入文件:
echo 正在搜索,请稍候...
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
if exist %%a:\ (
for /f "delims=" %%b in ('dir /a-d /s /b "%%a:\*test.bat" 2^>nul') do (
if /i "%%~nxb" equ "test.bat" (
echo 搜索结束,文件路径为:%%b
for %%a in (%%b) do (
echo 保留文件名及后缀信息:%%~nxa
)
)
)
)
)
goto continue