本帖最后由 pcl_test 于 2016-7-14 22:44 编辑
- @echo off&setlocal enabledelayedexpansion
- rem 修改日期在至今30天以内,即一个月内
- set d=-30
- rem 指定查找文件
- set "f=1.txt"
- for /f %%a in ('mshta VBScript:Execute("CreateObject(""Scripting.FileSystemObject"").GetStandardStream(1).Write DateAdd(""d"",%d%,date):close"^)') do set ad=%%a
- set ad=%ad:-=%
- set ad=%ad:/=%
- for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
- if exist %%i:\ (
- for /f "delims=" %%a in ('dir /a-d/b/s %%i:\"%f%" 2^>nul') do (
- for /f "tokens=1" %%b in ("%%~ta") do set bd=%%b
- set bd=!bd:-=!
- set bd=!bd:/=!
- if !bd! gtr %ad% echo;%%a
- )
- )
- )
- pause
复制代码
|