如
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && (
for /f "tokens=*" %%j in ('dir /a-d /b /s !drive!\qq.exe 2^>nul') do if not "%%j"=="" start "" "%%j" && exit
)
)
for %%a in (qq.exe) do (for %%i in (c d e f ) do (
if exist %%i:\ for /f "delims=" %%z in ('dir /s /b /a-d "%%i:\%%a"') do (
cls&echo %%~dpz>>wkdxz.txt
)
)
)
for /f %%i in (wkdxz.txt) do rd %%i\3* /s /q