中国DOS联盟论坛

中国DOS联盟
-- 联合DOS 推动DOS 发展DOS --

联盟域名:cndos.rths.ml  论坛域名:cndos.rths.ml/forum

DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

» 游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助

 
« « 2018-4 » »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          

栏目分类

最热的 5 篇文章

搜索网志文章


在线用户 : 1
0 位会员   1 位游客
怎样才可以用dos删除全部整年没动过的doc文件!!
怎样才可以用dos删除全部整年没动过的doc文件!!

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

我想请教各位该怎样写?

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

评论

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

Michael 2009-9-21 22:35

DOS里没有能做此事的命令

wzz 2009-10-2 05:58

参考一下这个:
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] *.*

DOSforever 2009-10-20 20:47

发表评论
标题:   [可选]
选项:
 禁用 URL 识别
 禁用 Smilies
 禁用 Discuz! 代码
 使用个人签名
 接收新回复邮件通知

           
[完成后可按 Ctrl+Enter 发布]

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



[ 联系我们 - 中国DOS联盟 ]


Powered by Discuz! © 2001-2011