@echo offsetlocal EnableDelayedExpansion REM 获取当前路径set "currentDir=%cd%" REM 遍历当前路径下的所有文件for %%f in ("%currentDir%\*.*") do ( echo %%~nxf) pause