China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-04 06:44
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to list files modified from a certain date up to now, with modification time and full path View 1,076 Replies 3
Original Poster Posted 2007-04-22 06:26 ·  中国 河北 石家庄 联通
新手上路
Credits 10
Posts 3
Joined 2007-04-22 05:11
19-year member
UID 86050
Gender Male
Status Offline
Floor 2 Posted 2007-04-22 06:37 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
Here's an idea: get the file modification date:
set Date_=2007-02-04
set Date_=%Date_:-=%
if %Date_% GEQ %StartDate% if %Date_% LEQ %EndDate% ......
Floor 3 Posted 2007-04-22 06:58 ·  中国 河北 石家庄 联通
新手上路
Credits 10
Posts 3
Joined 2007-04-22 05:11
19-year member
UID 86050
Gender Male
Status Offline
Thanks zh159
I know a little of the basic DOS statements, but once it gets into combined statements I'm OVER.
....need to study it further
Floor 4 Posted 2007-04-22 08:14 ·  中国 广西 玉林 博白县 电信
金牌会员
★★★★
Credits 3,687
Posts 1,467
Joined 2005-08-08 12:00
20-year member
UID 44210
Status Offline
@echo off
setlocal EnableDelayedExpansion
echo.
set Startdate=20070108
set /p Startdate= Enter start date (format: 20070108):
set Enddate=%date:~0,10%
set Enddate=%Enddate:-=%
echo.
for /f %%i in ('dir/on/s/b *.jpg^|findstr ".jpg"') do (
set Date_=%%~ti
set Date_=!Date_:-=!
if !Date_! GEQ %StartDate% if !Date_! LEQ %EndDate% echo. %%i
)
pause
Forum Jump: