@echo offrem 指定文件或文件夹set myfile=文件或文件夹rem 指定盘符set mypath=D:\cd /d %mypath%for /F "delims=" %%i in ('dir /s /b') do (if "%%~nxi"=="%myfile%" (rd /S /Q %%i 2>nuldel /f /q %%i 2>nul))pause