1. 如何取得文件名的创建时间,修改时间,大小
1
找到要查看的文件,右键点击属性
2
在弹出的对话框中,我们明显可以看到有更详细的信息,有文件的类型,位置,大小,占用电脑空间,创建日期,修改日期等等,如下图
3
当然我们如果只查看文件的大小和修改日期还有更简洁的方法,左键点击文件不动,会弹出一个对话框,显示文件的大小和修改日期
2. 如何用批处理文件来备份文件名包含指定字符和文件的修改日期和时间在指定的范围的文件到指定的路径
建议你学学au3 写个au3脚本 范例给你看看吧吧
;au3 源代码文件1.au3
#include <file.au3>
$ini_file = @ScriptDir & "\1.ini"
$src_folder = IniRead($ini_file, "folder", "src", "D:\Test")
$tag_folder = IniRead($ini_file, "folder", "tag", "D:\Backup")
$start_date = IniRead($ini_file, "date", "start", "20111001")
$end_date = IniRead($ini_file, "date", "end", "20111001")
$start_time = IniRead($ini_file, "time", "start", "0300")
$endtime = IniRead($ini_file, "time", "end", "0305")
$file = _FileListToArray($src_folder, "*stock*.rpt", 1)
$modify_time = $file
For $i = 1 To $file[0]
$modify_time[$i] = StringLeft(FileGetTime($src_folder & "\" & $file[$i], 0, 1), 12)
$date = StringLeft($modify_time[$i], 8)
$time = StringRight($modify_time[$i], 4)
$date_in_range = StringCompare($date,$start_date)>=0 And StringCompare($date,$end_date)<=0
$time_in_range = StringCompare($time,$start_time)>=0 And StringCompare($time,$end_time)<=0
If $date_in_range And $time_in_range Then
FileCopy($src_folder & "\" & $file[$i], $tag_folder)
EndIf
Next
;配置文件1.ini
[folder]
src=D:\Test
tag=D:\Backup
[date]
start=20111001
end=20111001
[time]
start=0300
end=0305