@echo off
set file=要复制的文件.exe
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: (
if exist "%%A:\%file%" set "fpath=%%A:\%file%" & goto next
for /f "delims=" %%a in ('dir /s /a:-d /b "%%A:\%file%" 2^>nul') do (
set "fpath=%%a" & goto next
)
)
)
exit /b
:next
for %%a in (z y x w v u t s r q p o n m l k j i h g f e d c) do (
if exist %%a: (
copy /y "%fpath%" "%%a:\"
exit /b
)
)