WinMerge / winmerge

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
https://winmerge.org/
GNU General Public License v2.0
6.33k stars 786 forks source link

Windows 11 changes date when copying what makes comparing with "Modified Date and Size" obsolet #2375

Closed Megateaser closed 1 week ago

Megateaser commented 1 month ago

After a Compare "Modified Date and Size" and subsequent copying of the different files to the target drive, the modification date is now changed under Windows 11. This means that all updated files are declared as different during the next "Modified Date and Size" compare. This does not happen under Windows 10 - until recently also not under Windows 11. What can I do to ensure that the modification date is retained when copying?

Thx for helpful comments Megateaser

auge8472 commented 1 month ago

Travel to Seattle and ... 😉

I know, not very helpful but the change seems to be made in the OS.

sdottaka commented 1 month ago

Are you using WinMerge to copy files? Or are you using Explorer to copy files? Either way, I could not replicate this issue on Windows 11. Is the destination drive a special file system?

Megateaser commented 1 month ago

Are you using WinMerge to copy files? Or are you using Explorer to copy files? Either way, I could not replicate this issue on Windows 11. Is the destination drive a special file system?

Sorry for my late answer. Yes, I am using WinMerge to copy files. The problem startet recently (on the same hardware it was running before). I use to compare from my NAS (QNAP) to an USB-Stick (NTFS) and copy those files, that have a different "Date and Size". I noticed that copying files to the desktop on Windows 11 does change the date/time as well. Therefore I thought it has to do with Windows 11 (and because on a Windows 10 System using same NAS and USB-Stick it still works fine...

PS: I found this comment in relation (translated): "Robin Manthey [SP_Data]Answered on June 17, 2024 Actually, only the creation date should change to the time of copying. The modification date should remain on that of the original, was always the same under Win10, under WIn11 it is now apparently different on some clients. Isn't that more of an error?" Source: https://answers.microsoft.com/de-de/windows/forum/all/warum-%C3%A4ndert-sich-das-erstelldatum-einer/54d80aac-3abd-4017-bd7b-e96c5154e571

sdottaka commented 1 month ago

Is this related to the following FAQ?

https://www.qnap.com/en/how-to/faq/article/why-do-the-timestamps-of-my-shared-files-sometimes-change-after-accessing-them-with-the-apple-filing-protocol-afp

WinMerge uses Win32API IFileOperation(https://learn.microsoft.com/ja-jp/windows/win32/api/shobjidl_core/nn-shobjidl_core-ifileoperation) to copy files.

This is probably what Explorer uses too.

Does the file modification date and time change when you copy a file with Explorer?

If it does change, it may be difficult to take measures on the WinMerge side.

Megateaser commented 1 month ago

Thanks for your reply. I checked the actual settings on my QNAP, sending attached pics. 20240726 091050 20240726 091108 20240726 092029 20240726 092045 20240726 092058

But there were no settings changed on the QNAP since >24 month and this "modificatio date" problem appeared first recently and only on Win11.

Should I change SMB-settings? I only use Windows PCs. Since I need running Win98 on Virtual Machines and I need access to the NAS, SMB1 is activated. Do you suggest turning off SMB1/changing/trying somethink in this settings?

You asked "Does the file modification date and time change when you copy a file with Explorer?" Yes, it does, if I copy eg. a file from the NAS to my desktop. But only on Win11, not on Win10 - Systems. On the Win10 "modification date" remains.

PS: If I copy a file from a memory stick to my Win11 Desktop "modification date" remains. I guess it turns the finger in direction QNAP. Perhaps last firmware update did something?!

sdottaka commented 1 month ago

Unfortunately, I don't have a QNAP NAS so I don't know. If the last modified date of a file changes even in Explorer, it seems difficult to take any measures within WinMerge.

fkbreitl commented 2 weeks ago

This seems related: https://answers.microsoft.com/en-us/windows/forum/all/file-explorer-and-date-createdmodified-change-when/e6ad833e-a134-4da8-a9e0-815c92eeecfa

https://answers.microsoft.com/pl-pl/windows/forum/all/a-date-of-a-file-during-copying-files/1a45b29d-0474-4d54-82a5-7482d9a323dc

Megateaser commented 1 week ago

Thanks a lot Frank! Problem is solved by adding the NAS to the Local Internet Zone as described in the 2nd link you sent: "To open IE Options, run "inetcpl.cpl". Click on the "Security" tab, and click "Local Intranet". Click "Sites", and click "Advanced". Add the computer name or the IP address of the computer that hosts the network share to the list. Click OK, OK, to save your settings."