#AutoIt3Wrapper_Icon=RedFish.ico ;Filename of the Ico file to use

#include <File.au3>
#include <Array.au3>
#include <String.au3>
#include <Process.au3>


_RunDOS( "dir /AD /B /OD > logs.txt" )

$file = FileOpen("logs.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
$line = FileReadLine($file)
If @error = -1 Then ExitLoop
;MsgBox(0, "Line read:", $line)
$readme = FileOpen( @WorkingDir & "\" & $line & "\" & "readme.txt", 1)
If $readme = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
FileClose($readme)
;修改時間
;找看看有沒有AVI檔案
$search = FileFindFirstFile( @WorkingDir & "\" & $line & "\" &"*.avi" )
If $search = -1 Then
$search = FileFindFirstFile( @WorkingDir & "\" & $line & "\" &"*.mp4" )
If $search = -1 Then
$search = FileFindFirstFile( @WorkingDir & "\" & $line & "\" &"*.wmv" )
If $search = -1 Then
ContinueLoop
EndIf
EndIf
EndIf
$movie_file = FileFindNextFile($search);第一個影片檔案名稱
$FileTime = FileGetTime ( @WorkingDir & "\" & $line & "\" &$movie_file , 0 , 1 );取出影片的日期

FileSetTime ( @WorkingDir & "\" & $line , $FileTime , 0 , 1 );type: 0 = Modified (default), 1 = Created, 2 = Accessed "YYYYMMDDHHMMSS"
FileSetTime ( @WorkingDir & "\" & $line , $FileTime , 1 , 1 );type: 0 = Modified (default), 1 = Created, 2 = Accessed $YYYYMMDDHHMMSS = $FileTime[]
FileSetTime ( @WorkingDir & "\" & $line , $FileTime , 2 , 1 );type: 0 = Modified (default), 1 = Created, 2 = Accessed

FileClose($search)
;修改時間
Wend

FileClose($file)

創作者介紹

推理文by阿誠

abort 發表在 痞客邦 PIXNET 留言(0) 人氣()