中国DOS联盟

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

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

中国DOS联盟论坛
现在时间是 2026-06-13 19:37
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » DOS 下如何对指定时间段的文件操作.
楼 主 DOS 下如何对指定时间段的文件操作. 发表于 2009-06-20 23:12 ·  中国 陕西 西安 联通
新手上路
积分 4
发帖 1
注册 2009-06-20 00:07
UID 147758
性别 男
状态 离线
想要把某个目录下(包含子目录)所有日期的修改时间为大于早七点三十分小于晚八点十五分的所有文件全部找出来并拷贝走或者全部删除也行,试了xcopy命令但只是支持天不支持小时分钟秒.
2 发表于 2009-06-28 10:07 ·  中国 上海 电信
金牌会员
★★★★
积分 4,639
发帖 2,239
注册 2005-01-30 00:00
UID 35785
性别 男
状态 离线
介绍一个参数,这个参数差不多可以在所有以文件为操作对象的 4DOS 命令中使用

4DOS Help Topic: Time Ranges


A time range specifies a file modification time without reference to the
date. For example, to select files modified between noon and 2:00 pm on any
date, use /. The times in a time range can either be in
12-hour format, with a trailing "a" for AM or "p" for PM, or in 24-hour
format.

If you omit the second argument in a time range, you will select files that
were modified between the first time and the current time, on any date. You
can also use offsets, beginning with a plus sign or a minus sign for
either or both of the arguments in a time range. The offset values are
interpreted as minutes. Some examples:

Specification Selects Files

/ modified between noon and 2:00 PM on any date
/ modified between two hours ago and the current
time on any date
/ modified in the morning on any date

The standard FAT file system maintains a single time for each file,
reflecting the last time the file was written. This is the time 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, time ranges work with the last write time stamp. You
can use the "last access" (a) or "created" (c) time stamp in a time range
with the syntax:

/ or /


如按照你具体的需求:修改时间大于七点三十分小于晚八点十五分
可以这样

copy /s / ... ...

del /s / ...
论坛跳转: