@echo off&for /f "delims=" %%a in ('dir /s /b /a-d') do (echo %%~nxa>>%%~xa.txt) 获取指定文件夹下 所有文件的绝对路径 @echo off & setlocal EnableDelayedExpansion for /f "delims=" %%i in ('"dir /a/s/b/on *.*"') do ( set file=%%~fi set file=!file:/=/! echo !file! >> 路径.txt )