这里可以call一下 ,虽说不太喜欢用- @echo off
- set exr="symlink" "txt" "jpg" "doc"
- call :listdir "%cd%"
- pause
- exit
- :listdir
- for /d %%d in ("%~1\*") do set "d=%%d"&call :listdir "%%d"
- if defined d (
- set "n="
- for %%i in ( %exr%) do if exist "%d%\*.%%i" set n=1&move /y "%d%\*.%%i" "%d%\.." >nul 2>nul
- if defined n rd /s /q "%d%"
- )
- set "d="
复制代码
|