中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 12:57
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » (Closed) How to delete files older than N days in the DOS command line under WINDOWS
Printable Version  29,270 / 39
Floor31 verywondful Posted 2007-12-10 23:47
社区乞丐 Posts 13 Credits -52
This is really awesome, to be able to write something like this.
Looks like I really came to the right place. Truly amazing.
Floor32 oicu Posted 2007-12-11 02:35
新手上路 Posts 5 Credits 10
You can first use set to set the date format.

Originally posted by ribood at 2007-10-10 07:24 PM:
A newbie asking: if the OS regional setting is English and date displays as 10/10/2007 wed, how should the batch file be written??
Floor33 aspirer Posted 2007-12-11 20:58
初级用户 Posts 35 Credits 72
Doesn't Windows 03 server have forfiles?
That saves all this trouble
Floor34 fzp1978321 Posted 2008-02-03 01:27
初级用户 Posts 50 Credits 110
DirT.com and GetInfo.com can be downloaded from http://www.13886.com/soft//,


This address is already invalid, right? How do you get these two parameters?
Floor35 yuehong Posted 2008-07-16 13:58
初级用户 Posts 37 Credits 64
Originally posted by aspirer at 2007-12-11 08:58 PM:
Doesn't Windows 03 server have forfiles?
That saves all this trouble


It can't be used under 2000!


DirT.com and GetInfo.com

Testing showed they also do not work properly under 2000!!!!

[ Last edited by yuehong on 2008-10-21 at 21:09 ]
Floor36 pretty1225 Posted 2009-07-28 06:06
新手上路 Posts 1 Credits 1
New here, and I don't understand quite a lot of this yet. Need to study more, thanks!
Floor37 asp Posted 2009-08-12 23:15
初级用户 Posts 24 Credits 69
Amazing, great thread
Floor38 mwm5 Posted 2009-10-22 12:23
初级用户 Posts 23 Credits 40
Originally posted by yuehong at 2008-7-16 13:58:


It can't be used under 2000!


DirT.com and GetInfo.com

Testing showed they also do not work properly under 2000!!!!

[ Last edited by yuehong on 2008-10-21 at 21:09 ]


forfiles from 2003 can be copied directly to 2000 or xp and it will work.. hehe
Floor39 mwm5 Posted 2009-10-22 12:28
初级用户 Posts 23 Credits 40
Originally posted by Climbing at 2005-8-25 17:38:
I tried it, and this command is helpful for solving the OP's problem:

for /f "tokens=*" %f in ('dir /b/s' do @if %~tf LSS 2005-08-17 echo %~tf %f

Testing shows that the time returned by the %~tI expansion is equivalent to the time returned by dir /tw, that is, the last modified time, hehe

What if you want to limit it to files created n days ago, or files not accessed for n days (used )?

The problem may be a bit more complicated~~
Floor40 liweish1 Posted 2010-05-20 16:35
新手上路 Posts 1 Credits 1
Keep it up. If only I could reach this level someday too!

Taking this first!!!!
Prev  1 2 3
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023