标签:log enum name http lis pat enable echo end
@echo off set arg=%1 if "%arg%" == "" set arg=* if "%arg%" == "-h" ( echo sort by numbers in filename echo usage: nsort [drive:][path][filename] exit /b ) setlocal EnableExtensions for /F "delims=" %%I in (‘dir %arg% /A-D /B /ON 2^>nul‘) do call :AddToFileList "%%I" for /F "tokens=1* delims==" %%I in (‘set FileList[ 2^>nul‘) do echo %%J endlocal exit /B :AddToFileList set "FileName=%~n1" if "%FileName%" == "" set "FileName=%~x1" set "FileNumber=" :GetFileNumber for /F "delims=0123456789" %%I in ("%FileName:~-1%") do goto AddFileToArray set "FileNumber=%FileName:~-1%%FileNumber%" set "FileName=%FileName:~0,-1%" if not "%FileName%" == "" goto GetFileNumber :AddFileToArray set "FileNumber=00000%FileNumber%" set "FileNumber=%FileNumber:~-5%" set "FileList[%FileName%_%FileNumber%]=%~1" goto :EOFnsort.7z
标签:log enum name http lis pat enable echo end
原文地址:http://www.cnblogs.com/nlsoft/p/6072064.html