2013koko 当前离线
列兵
TOP
cutebe 当前离线
上尉
(for /f "delims=" %%a in ('dir/a-d/b/s/og "%~1"')do @echo %%~nxa)>"%~dp0outfile.txt"复制代码
newswan 当前离线
@echo off setlocal enableDelayedExpansion if "%~1"=="" echo,请拖入文件夹到本文件上&pause&exit /b for /f "usebackq" %%a in (`Powershell -c "'%1'.Length"`) do ( set /a n=%%a+1 ) for /f "delims=" %%j in ('"dir /a/s/b/on %1"') do ( set str=%%~j set str=!str:~%n%! echo !str! ) pause 得到全路径,截取复制代码
xp3000 当前离线
少尉
@echo off if "%~1"=="" echo,请拖入文件夹到本文件上&pause&exit /b for %%i in (%*) do ( for /f "delims=" %%j in ('"dir /a/s/b/on %%i"') do ( echo %%~nxj ))>>名称.txt pause复制代码
dir/a-d/b/og "%~1">"%~dp0outfile.txt"复制代码