
CODE: [Copy to clipboard]@echo off
setlocal enabledelayedexpansion
for %%a in ("C:\test\*.*") do (
for /f "skip=1 delims=:" %%b in ('^(echo "%%~nxa"^&echo.^)^|findstr /o ".*"') do set /a length=%%b-5
if !length! lss 10 (
set .00!length!%%~nxa=%%~nxa
) else if !length! lss 100 (
set .0!length!%%~nxa=%%~nxa
) else (
set .!length!%%~nxa=%%~nxa
)
)
for /f "tokens=2 delims==" %%a in ('set .') do echo %%a
CODE: [Copy to clipboard]@echo off
setlocal enabledelayedexpansion
for %%a in ("C:\test\*.*") do (
for /f "skip=1 delims=:" %%b in ('^(echo "%%~nxa"^&echo.^)^|findstr /o ".*"') do set /a length=%%b-5
if !length! lss 10 (
set .00!length!%%~nxa=%%~nxa
) else if !length! lss 100 (
set .0!length!%%~nxa=%%~nxa
) else (
set .!length!%%~nxa=%%~nxa
)
)
for /f "tokens=2 delims==" %%a in ('set .') do echo %%a>>C:\result.txt
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |