Synchronize Dirs changes folders date/time

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
IlanSh
Junior Member
Junior Member
Posts: 25
Joined: 2019-01-13, 22:34 UTC

Synchronize Dirs changes folders date/time

Post by *IlanSh »

When syncing two dirs with subdirs, file maintain their original date/time, but folders do not - they get the current date/time. Is there a way to prevent this behavior so folders will maintain the original date/time?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Synchronize Dirs changes folders date/time

Post by *Horst.Epp »

Thats a Windows function.
It updates the folder dates if anything is changed inside.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
IlanSh
Junior Member
Junior Member
Posts: 25
Joined: 2019-01-13, 22:34 UTC

Re: Synchronize Dirs changes folders date/time

Post by *IlanSh »

Horst.Epp wrote: 2022-01-01, 09:20 UTC Thats a Windows function.
It updates the folder dates if anything is changed inside.
Isn't there away to correct this? I need the synced directories to be identical including folders date and time.
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: Synchronize Dirs changes folders date/time

Post by *Gral »

I have been using this button on the button bar for many years.
(copy code, click on empty space on buttonbar and choose "Paste")

Code: Select all

TOTALCMD#BAR#DATA
ROBOCOPY.EXE
%P%N %T%N *. /BYTES /TEE /E /DCOPY:T /NP /R:5 /W:5
%COMMANDER_EXE%,34



-1
You can remove /BYTES /TEE and /NP and change parameter for /R and /W options so button will be look like, e.g. :

Code: Select all

TOTALCMD#BAR#DATA
ROBOCOPY.EXE
%P%N %T%N *. /E /DCOPY:T /R:2 /W:2
%COMMANDER_EXE%,34



-1


P.S. Put cursor on source "UP" directory entry prior to use button.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Synchronize Dirs changes folders date/time

Post by *Horst.Epp »

I prefer the tool FolderTimeUpdate from NirSoft.
I let the dirs set to the time stamp of the newest file inside of it.
https://www.nirsoft.net/utils/folder_time_update.html
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: Synchronize Dirs changes folders date/time

Post by *Gral »

This is something completely different - note that folders datetimes we want restore may be unrelated to newest file datetime or even any file datetime.
With such a ROBOCOPY button we don't need set any parameters - just press the button - one click. This is also very fast.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Synchronize Dirs changes folders date/time

Post by *Horst.Epp »

Gral wrote: 2022-01-01, 17:40 UTC This is something completely different - note that folders datetimes we want restore may be unrelated to newest file datetime or even any file datetime.
With such a ROBOCOPY button we don't need set any parameters - just press the button - one click. This is also very fast.
For me a folder time is always related to its contents.
Different folder time means different content.
A completely unrelated time makes no sense for me.
Thats the reason why Microsoft updates the folder time if the content changes.

Btw. I also click just a button and its happens without any big delay.

Code: Select all

TOTALCMD#BAR#DATA
C:\Tools\NirSoft\x64\FolderTimeUpdate.exe
/BaseFolder %S  /scomma c:\temp\FolderTimeUpdate_%N_log.csv
C:\Tools\NirSoft\x64\FolderTimeUpdate.exe
FolderTimeUpdate


-1
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: Synchronize Dirs changes folders date/time

Post by *Gral »

Horst.Epp wrote: 2022-01-01, 18:03 UTC ...
For me a folder time is always related to its contents.
...
Sorry, it's for you, but we probably should consider only solutions desired by OP.
Also note such a example:
You have folder with datetime set to newest file, right?
After hour/day/month you copy or move old file from another folder.
Folder gets current datetime, but there's no files with this datetime, right?
Or just delete newest file, same effect.
So folder datetime is related to ACTION datetime, no file datetime!
This is what Microsoft really do! Still no sense?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Synchronize Dirs changes folders date/time

Post by *Horst.Epp »

Gral wrote: 2022-01-01, 18:15 UTC ...
So folder datetime is related to ACTION datetime, no file datetime!
You are right but thats the reason for me to set it related to the contents.
Having just a fixed date for the folder would not give me any hint about its contents.

Given the folder date of the source tree is set my way
I let just update the target dir after a sync
and it will get the exact same folder dates as the source.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: Synchronize Dirs changes folders date/time

Post by *Gral »

Do you search frequently through system folders: Windows, Program Files and so on and set datetimes to newest files on every folder? :D
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Synchronize Dirs changes folders date/time

Post by *Horst.Epp »

Gral wrote: 2022-01-01, 18:36 UTC Do you search frequently through system folders: Windows, Program Files and so on and set datetimes to newest files on every folder? :D
Of course not, I'm not interested on system folders :)
I make regular folder time updates for my Pictures und Document folders.
For all the rest folder times are not relevant for me.
I search for folders, files and contents using Everything 1.5 and nothing else.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Synchronize Dirs changes folders date/time

Post by *petermad »

IlanSh wrote: 2022-01-01, 14:51 UTC Isn't there away to correct this? I need the synced directories to be identical including folders date and time.
It is related to the NTFS file system. The timestamp will stay untouched on FAT 32 or exFAT formatted disks.
Last edited by petermad on 2022-01-03, 11:15 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
IlanSh
Junior Member
Junior Member
Posts: 25
Joined: 2019-01-13, 22:34 UTC

Re: Synchronize Dirs changes folders date/time

Post by *IlanSh »

Horst.Epp and Gral, many thanks! I chose the NirSoft solution, I have "CLIphobia"
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Synchronize Dirs changes folders date/time

Post by *Horst.Epp »

If you use the NirSoft tool
Before using the button, start the GUI once to set default options.
Most importand is to set
x Update also the base folder

The button example stores the log file in CSV format
as this is easy to read with Lister plugin CSVView for example.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Ralph
Junior Member
Junior Member
Posts: 97
Joined: 2004-08-21, 14:58 UTC
Location: USA

Re: Synchronize Dirs changes folders date/time

Post by *Ralph »

In TC, you could use

Configuration > Options > Copy/Delete tab > Copy date/time of directories

If you want to edit wincmd.ini directly, the command is [Configuration] > CopyDirTimeStamp=1
Post Reply