|
uemuem
初级用户
 
积分 153
发帖 68
注册 2006-10-12 来自 上海
状态 离线
|
『楼 主』:
怎么样读取一个文件的修改时间
使用 LLM 解释/回答一下
在论坛里面找了一遍,没有谈到这个问题的帖子,所以发帖求助大家:
怎么样读取一个文件的修改时间,比如:D:\test.xls
怎么样来取得这个文件的修改时间比如:2006年6月13日, 13:36:28
Last edited by uemuem on 2006-10-14 at 01:33 ]
I searched the forum and didn't find a post discussing this issue, so I'm posting to ask everyone for help:
How to read the modification time of a file, for example: D:\test.xls
How to obtain the modification time of this file, for example: June 13, 2006, 13:36:28
Last edited by uemuem on 2006-10-14 at 01:33 ]
|
|
2006-10-13 21:35 |
|
|
9527
银牌会员
     努力做坏人
积分 1185
发帖 438
注册 2006-8-28 来自 北京
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
@echo off
echo %~t1 保存为 test.cmd
运行 test.cmd d:\test.xls 应该就可以看到啦
@echo off
echo %~t1 Saved as test.cmd
Running test.cmd d:\test.xls should allow you to see it
|

我今后在论坛的目标就是做个超级坏人!!! |
|
2006-10-13 21:45 |
|
|
uemuem
初级用户
 
积分 153
发帖 68
注册 2006-10-12 来自 上海
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
谢谢,这样可以,但是有点麻烦,能不能把它合并到一个BAT文件,然后将结果保存到1.txt里面,我刚刚试了,不知道该怎么做,都不对的。
Thanks, this works, but it's a bit cumbersome. Can you combine it into one BAT file and save the result to 1.txt? I just tried it and it didn't work properly.
|
|
2006-10-13 21:54 |
|
|
9527
银牌会员
     努力做坏人
积分 1185
发帖 438
注册 2006-8-28 来自 北京
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
@echo off
call :dan D:\test.xls
start 1.txt
goto :eof
:dan
echo %~t1 >1.txt
goto :eof
Last edited by pip on 2006-10-14 at 02:45 ]
@echo off
call :dan D:\test.xls
start 1.txt
goto :eof
:dan
echo %~t1 >1.txt
goto :eof
Last edited by pip on 2006-10-14 at 02:45 ]
|

我今后在论坛的目标就是做个超级坏人!!! |
|
2006-10-13 22:00 |
|
|
uemuem
初级用户
 
积分 153
发帖 68
注册 2006-10-12 来自 上海
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
真是太谢谢了,谢谢PIP,我是想用他来判断文件是否修改过,然后再作备份!
Really thank you, thank you PIP, I want to use him to judge whether the file has been modified, and then make a backup!
|
|
2006-10-13 22:02 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-10-13 22:12 |
|
|
uemuem
初级用户
 
积分 153
发帖 68
注册 2006-10-12 来自 上海
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
版主说的有点高深,不太懂
能给个例子吗?
或者给个自动备份的代码,让菜鸟学习学习,刚刚入门,要学的东西实在太多。
比如:我要判断D:\test.xls是否更改过,更改过则备份到E:\test修改时间.xls,没更改过则不要动作。。。
Last edited by uemuem on 2006-10-13 at 22:47 ]
The moderator's words are a bit advanced, and I don't quite understand.
Can you give an example?
Or give an automatic backup code for beginners to learn. I've just started and have too many things to learn.
For example: I want to judge whether D:\test.xls has been changed. If it has been changed, back it up to E:\test modification time.xls; if it hasn't been changed, do nothing...
Last edited by uemuem on 2006-10-13 at 22:47 ]
|

个人主页-找餐厅:http://www.canting.cc |
|
2006-10-13 22:41 |
|
|
vkill
金牌会员
     
积分 4103
发帖 1744
注册 2006-1-20 来自 甘肃.临泽
状态 离线
|
|
2006-10-13 23:39 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
最常用的命令里往往包含了最强大的功能,请看dir的相关帮助信息:
DIR attributes]]
sortorder]] timefield]]
……
timefield C 创建时间
A 上次访问时间
W 上次写入的时间
The most commonly used commands often contain the most powerful functions. Please see the relevant help information for dir:
DIR attributes]]
sortorder]] timefield]]
……
timefield C Creation time
A Last access time
W Last write time
|

尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2006-10-14 01:04 |
|