中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 15:49
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » How to backup the file with the largest timestamp in a directory
Printable Version  2,022 / 3
Floor1 hb3937 Posted 2011-01-17 14:58
新手上路 Posts 2 Credits 2
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.
Floor2 fsfss Posted 2011-01-17 15:20
初级用户 Posts 20 Credits 22
for %%i in (RUN*) do @set 最新时间的文件=%%i
echo.%最新时间的文件%
Floor3 Hanyeguxing Posted 2011-01-17 16:18
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Compare with what time? Creation, modification, access or file name? Compare with which time?
Floor4 hb3937 Posted 2011-01-17 17:55
新手上路 Posts 2 Credits 2
It is the generation time of this file on the local machine. Thanks for the reply
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023