中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » 怎样才可以用dos删除全部整年没动过的doc文件!!
作者:
标题: 怎样才可以用dos删除全部整年没动过的doc文件!! 上一主题 | 下一主题
SinLow
初级用户





积分 70
发帖 33
注册 2009-9-15
状态 离线
『楼 主』:  怎样才可以用dos删除全部整年没动过的doc文件!!

怎样才可以用dos删除全部整年没动过的doc文件!!

我想删除在电脑全部一年里都没动的doc文件!

我想请教各位该怎样写?

要用什么指令才能知道那个文件已整年没用呢?

2009-9-17 02:53
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
Michael
钻石会员





积分 10046
发帖 3039
注册 2002-11-11
状态 离线
『第 2 楼』:  

你不如用windows的查找方便一些,然后按访问时间排排序.



简单就是美
2009-9-21 22:35
查看资料  发短消息 网志   编辑帖子  回复  引用回复
wzz
新手上路





积分 13
发帖 7
注册 2007-5-1
状态 离线
『第 3 楼』:  

DOS里没有能做此事的命令

2009-10-2 05:58
查看资料  发短消息 网志   编辑帖子  回复  引用回复
DOSforever
金牌会员





积分 4639
发帖 2239
注册 2005-1-30
状态 离线
『第 4 楼』:  

参考一下这个:
http://www.cn-dos.net/forum/view ... 7922&#pid336450

如果是要选择日期范围的话

  Quote:

4DOS Help Topic:  Date Ranges


Date ranges select files that were created or last modified at any time
between the two dates.  For example, /[d12-1-99,12-5-99] selects files that
were last modified between December 1, 1999, and December 5, 1999.

You can use hyphens, slashes, or periods to separate the month, day, and
year.  4DOS generally accepts dates between January 1, 1980 and December 31,
2099.  The year can be entered as a 2-digit or 4-digit value.  Two-digit
years between 80 and 99 are interpreted as 1980 - 1999; values between 00
and 79 are interpreted as 2000 - 2079.  References to years beyond 2079 must
be entered with 4 digits.  For example, /[d12-31-99,1-1-00] is equivalent to
/[d12-31-1999,1-1-2000], and selects files modified on December 31, 1999 or
January 1, 2000.

If an argument begins with a four digit year greater than 1900, it's assumed
to be a date in the ISO 8601 international format (yyyy-mm-dd).  If the date
contains the letter "W", it is assumed to be in the ISO 8601 week date
format yyyy-Www-d, where yyyy = year, ww = week, d = week day.  If the date
is entered as two numbers in the format yyyy-ddd, it is assumed to be in the
ISO 8601 ordinal date format, where yyyy = year, ddd = day of the year.

The time for the starting date defaults to 00:00:00 and the time for the
ending date defaults to 23:59:59.  You can alter these defaults, if you
wish, by including a start and stop time inside the date range.  The time is
separated from the date with an at sign [@].  For example, the range
/[d7-1-00@8:00a,7-3-00@6:00p] selects files that were modified at any time
between 8:00 am on July 1, 2000 and 6:00 pm on July 3, 2000.  If you prefer,
you can specify the times in 24-hour format (e.g., @18:00 for the end time
in the previous example).

If you omit the second argument in a date range, 4DOS substitutes the
current date and time.  For example, /[d10-1-99] selects files dated between
October 1, 1999 and today.

You can use an offset value for either the beginning or ending date, or
both.  An offset begins with a plus sign [+] or a minus sign [-] followed by
an integer.  If you use an offset for the second value, it is calculated
relative to the first.  If you use an offset for the first (or only) value,
the current date is used as the basis for calculation.  For example:

     Specification       Selects Files

     /[d10-27-99,+3]     modified between 10-27-99 and 10-30-99
     /[d10-27-99,-3]     modified between 10-24-99 and 10-27-99
     /[d-0]              modified today (from today minus zero days, to
                         today)
     /[d-1]              modified yesterday or today (from today minus one
                         day, to today)
     /[d-1,+0]           modified yesterday (from today minus one day, to
                         zero days after that)

As a shorthand way of specifying files modified today, you can also use
/[d]; this has the same effect as the /[d-0] example shown above.

To select files last modified n days ago or earlier, use /[dn,1/1/80].  For

example, to get a directory of all files last modified 3 days or more before
today (i.e., those files not modified within the last 3 days), you could use
this command:

     c:\> dir /[d-3,1/1/80]

This reversed date range (with the later date given first) will be handled
correctly by 4DOS.  It takes advantage of the facts that an offset in the
start date is relative to today, and that the base or "zero" point for PC
file dates is January 1, 1980.

Note:  If you do not specify a time in a reversed date range, the default
times will be applied before the first and second dates are swapped to
become the ending and starting dates respectively.  If you want to include
the entire first and last days of a reversed date range, simply add a
specific @00:00:00 to your intended start date and a @23:59:59 to your
intended end date.

You cannot use offsets in the time portion of a date range (the part after
an @ sign), but you can combine a time with a date offset.  For example,
/[d12-8-99@12:00,+2@12:00] selects files that were last modified between
noon on December 8 and noon on December 10, 1999.  Similarly,
/[d-2@15:00,+1] selects files last modified between 3:00 pm the day before
yesterday and the end of the day one day after that, i.e., yesterday.  The
second time defaults to the end of the day because no time is given.

The standard FAT file system maintains a single date for each file,
reflecting the last time the file was written.  This is the date used by
4DOS on a FAT drive with no LFN support (e.g. under MS-DOS 6.22, PC DOS 7.0
or 2000, DR-DOS 7.03 without LONGNAME loaded, or OS/2).

Drives which support long filenames (e.g. under Windows 95/98/ME, or under
plain DOS with a suitable LFN driver loaded) maintain 3 sets of dates and
times for each file: creation, last access, and last write (for last access
only the date is recorded; the last access time is always returned as
00:00).  By default, date ranges work with the last write time stamp.  You
can use the "last access" (a) or "created" (c) date/time stamp in a date
range with the syntax:

     /[da...]  or  /[dc...]

For example, to select files that were last accessed yesterday or today:

     /[da-1]

假如要删除从今天起超过一年以前的文件或许可以这样:

del /[d%_date,-365] *.*



DOS倒下了,但永远不死
DOS NEVER DIES !

投票调查:
http://www.cn-dos.net/forum/viewthread.php?tid=46187

本人尚未解决的疑难问题:
http://www.cn-dos.net/forum/viewthread.php?tid=15135
http://www.cn-dos.net/forum/viewthread.php?tid=47663
http://www.cn-dos.net/forum/viewthread.php?tid=48747
2009-10-20 20:47
查看资料  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: