Re: Komisches Windows-Problem mit FileSetTime
Posted: 13 Jul 2016, 05:40
Nein ich habe dieses Verhalten nicht. (Win 8.1 64)Zvonko wrote:@nnnik: Heißt das, dass du mit meinem ursprünglichen Demo-Skript bei dir das Problem nicht siehst?
Let's help each other out
https://www.autohotkey.com/boards/
Nein ich habe dieses Verhalten nicht. (Win 8.1 64)Zvonko wrote:@nnnik: Heißt das, dass du mit meinem ursprünglichen Demo-Skript bei dir das Problem nicht siehst?
Code: Select all
#NoEnv
Dat := 20000101010000
EmlDir := A_ScriptDir
EmlFile := "FileEml.eml"
EmlPath := EmlDir . "\" . EmlFile
FileDelete, %EmlPath%
FileAppend, , %EmlPath%
FileAppend, , %EmlPath%:OECustomProperty
; Run, Properties %EmlPath% ; WITHOUT THIS PART
; WinWait, ahk_class #32770 ; OF THE SCRIPT
; Send {Esc} ; WINDOWS REVOKES
; WinWaitClose ; THE SUBSEQUENT CHANGES MADE TO THE MODIFICATION TIME OF EML FILES
FileSetTime, %Dat%, %EmlPath%, C
FileSetTime, %Dat%, %EmlPath%, A
FileSetTime, %Dat%, %EmlPath%, M
FileGetTime, TimeEml, %EmlPath%, M
MsgBox The modification time of the files has been changed to Jan 1 2000.`r`nFileGetTime confirms this:`r`nEml: %TimeEml%
MsgBox Check now (after closing this MsgBox) the properties of the file.`r`nIs the modification time of the EML file changed as desired?
Run, *Explore %EmlDir%
Code: Select all
#NoEnv
IniFile := A_ScriptFullPath . ":INI"
IniWrite, %IniFile%, %IniFile%, Main, Path
IniRead, Path, %IniFile%, Main, Path
MsgBox, 0, IniRead, %Path%
FileRead, Content, %IniFile%
MsgBox, 0, FileRead, %Content%
ExitApp
Code: Select all
#NoEnv
SetBatchLines, -1
FileName := "Fully qualified file name"
For Index, Stream In EnumFileStreams(FileName)
MsgBox, 0, Stream #%Index%, % "Size: " . Stream.Size . "`nName: " . Stream.Name
EnumFileStreams(FileName) { ; msdn.microsoft.com/en-us/library/aa364424(v=vs.85).aspx
; FileName : The fully qualified file name.
Streams := []
If (DllCall("GetVersion", "UChar") < 6) ; requires Vista+ (not sure about this)
Return False
VarSetCapacity(FSD, 600, 0) ; WIN32_FIND_STREAM_DATA
HFIND := DllCall("FindFirstStreamW", "WStr", FileName, "Int", 0, "Ptr", &FSD, "UInt", 0, "Ptr")
If (HFIND <> -1) {
; Uncomment to add the main stream of the file (i.e. the file itself)
; Streams.Insert({Size: NumGet(&FSD, 0, "UInt64"), Name: StrGet(&FSD + 8, 296, "UTF-16")})
While DllCall("FindNextStreamW", "Ptr", HFIND, "Ptr", &FSD)
Streams.Insert({Size: NumGet(&FSD, 0, "UInt64"), Name: StrGet(&FSD + 8, 296, "UTF-16")})
DllCall("FindClose", "Ptr", HFIND)
Return Streams
}
Return False
}