中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-08-15 13:35
47,813 主题排行 / 349,903 发帖 / 今日 1 篇 / 48,257 会员排行
DOS疑难解答 & 问题讨论 (解答室) » DOS 下如何对指定时间段的文件操作.
可打印版本  1,197 / 1
第1楼 yzzhuu 发表于 2009-06-20 23:12
新手上路 发帖 1 积分 4
DOS 下如何对指定时间段的文件操作.
想要把某个目录下(包含子目录)所有日期的修改时间为大于早七点三十分小于晚八点十五分的所有文件全部找出来并拷贝走或者全部删除也行,试了xcopy命令但只是支持天不支持小时分钟秒.
第2楼 DOSforever 发表于 2009-06-28 10:07
金牌会员 发帖 2,239 积分 4,639
介绍一个参数,这个参数差不多可以在所有以文件为操作对象的 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 / ...
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023