for %%n in (c d e f )do if exist %%n:\ for /f "delims=" %%i in ('dir/ad/s/b "%%n:\*abc*"')do if /i "%%~nxi"=="abc" (
set a=
set "a=%%~fi"
call :1
)
pause
exit
:1
echo,%a%
goto:eof作者: lovealei 时间: 2018-2-2 10:51 标题: 为什么我列举了盘符后不能赋值给变量呢?
echo 移动磁盘:
for %%a in (E F G H I J K L M N O P Q R S T U V W X Y Z) do (fsutil fsinfo drivetype %%a: | find "可移动">nul && (set "aa=%%a"