场景: 有几个文件夹存放从不同地方下载下来的文件, 打开经常不方便. 这个脚本可以找到指定几个文件夹中最新更新的文件并打开该文件夹.
;以下文件夹可以自行更改增减****************
Folder1=E:\IDMDownload
Folder2=E:\BaiduNetdiskDownload
Folder3=E:\浏览器下载
foldernew :=""
Time_Orig :=""
;这里同步更改******************************
getlastfolder(folder1, file)
getlastfolder(folder2, file)
getlastfolder(folder3, file)
;run %folder%/%file%
run, explorer %foldernew%
getlastfolder(Folder,byref file="")
{
global
Loop, %Folder%\*
{
FileGetTime, Time, %A_LoopFileFullPath%, C
If (Time >= Time_Orig)
{
Time_Orig := Time
File := A_LoopFileName
foldernew = %folder%
; run,"%folder%"
; break
}
}
}
exitapp