- @echo off
- %1"%~f0" : | sort > 结果.log & pause & exit
- for /f "tokens=*" %%i in ('dir /b /s /ad') do echo %%~ti %%i
复制代码 如果想按创建日期排序:- @echo off & setlocal enabledelayedexpansion
- %1"%~f0" : | sort > 结果.log & pause & exit
- for /f "tokens=*" %%i in ('dir /s /ad /tc^|findstr /i /r /c:" 的目录$" /c:" \.$"') do (
- for /f "tokens=1*delims=<" %%j in ("%%i") do (
- if not "%%k"=="" (echo %%j!s:~,-4!) else set "s=%%i"
- )
- )
复制代码
|