Cannot get it right : Copy anything (files and folders or a whole disk) from where they are to where you want to copy them.
Keep it identical whether it's RASINDOC or/and Timestamp.
In the below code, that I cannot make working correctly, it's timestamps Created, Modified, Accessed (all of them) for all files and all folders.
I did manage to copy source to destination correctly, but I cannot get all timestamps in destination as they are in source.
Need a little push push to get back on track (may be a big one as I don't know how wrong I 'm . . .)
AHK_L 1.0.48.5 and XP SP3 Pro:
Source= "be carefull"
Dest= "be carefull"
Loop, %Source%\*.*, 1, 1 ;Loop thru whole selection
{
;______________Progress Bar_______________
GuiControl,, Progress, %A_Index% ; display progression in progress bar
;______________Progress Bar_______________
SplitPath, Source, SourceFolderName ; Extract only the folder name from its full path.
StringReplace, DestPath, A_LoopFileFullPath, %Source%, %Dest% ; Replace source with destination part of the loop full path
IfExist, %DestPath% ; if destination files/folders exist just need to set Modified Created Accessed TimeStamps
{
FileGetTime, Mtime, %Dest%, M
if Mtime !=%A_LoopFileTimeModified%
FileSetTime, A_LoopFileTimeModified, %Dest%, M, 1
FileGetTime, Ctime, %Dest%, C
if Ctime !=%A_LoopFileTimeCreated%
FileSetTime, A_LoopFileTimeCreated, %Dest%, C, 1
FileGetTime, Atime, %Dest%, A
if Atime!=%A_LoopFileTimeAccessed%
FileSetTime, A_LoopFileTimeAccessed, %Dest%, A, 1
}
else ; Always copy if target file doesn't yet exist.
{
IfNotInString,A_LoopFileAttrib,D ;if it's not a directory. If it's a file
FileCopy, %A_LoopFileFullPath%, %DestPath% ; Copy with overwrite=no
else ;Then, according to the IfNotInString above : if it's a directory. If it's not a file
FileCopyDir, %Source%, %Dest%\%SourceFolderName% ;0 (default): Do not overwrite existing files.
}
FileSetTime, %A_LoopFileTimeModified%, %Dest%\%SourceFolderName%, M, 1, 0
FileSetTime, %A_LoopFileTimeCreated%, %Dest%\%SourceFolderName%, C, 1, 0
FileSetTime, %A_LoopFileTimeAccessed%, %Dest%\%SourceFolderName%, A, 1, 0
}Eventually, I also didn't get how to code the progress bar.Edit : I deleted irrelevant code to make it easier to read.




