另外问一下代码里哪个地方是判断目录为空的?
$$@echo off for /f "delims=" %%a in ('dir /ad /b /s {获取的路径}^|sort /r') do ( rd "%%a">nul 2>nul &&echo 空目录"%%a"成功删除! ) pause