China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 12:38
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to backup the file with the largest timestamp in a directory View 1,890 Replies 3
Original Poster Posted 2011-01-17 14:58 ·  中国 北京 鹏博士BGP
新手上路
Credits 2
Posts 2
Joined 2010-12-23 12:08
15-year member
UID 179717
Gender Male
Status Offline
I have many files in a directory, and the file names are all RUNyyyymmddhhmmss, with a large number of subsequent digits being the time when the file was generated. Now the problem is, how to use batch processing to back up the file with the latest time to another directory.
Thank you everyone.
Floor 2 Posted 2011-01-17 15:20 ·  中国 湖北 黄石 电信
初级用户
Credits 22
Posts 20
Joined 2009-07-06 23:34
17-year member
UID 148862
Gender Male
Status Offline
for %%i in (RUN*) do @set 最新时间的文件=%%i
echo.%最新时间的文件%
Floor 3 Posted 2011-01-17 16:18 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Compare with what time? Creation, modification, access or file name? Compare with which time?
Floor 4 Posted 2011-01-17 17:55 ·  中国 北京 鹏博士BGP
新手上路
Credits 2
Posts 2
Joined 2010-12-23 12:08
15-year member
UID 179717
Gender Male
Status Offline
It is the generation time of this file on the local machine. Thanks for the reply
Forum Jump: