Copy Timestamp Feature (only for marked directories)

Here you can propose new features, make suggestions etc.

Moderators: petermad, Stefan2, white, Hacker

jnauth
Junior Member
Junior Member
Posts: 18
Joined: 2009-07-05, 22:38 UTC

Re: Copy Timestamp Feature (only for marked directories)

Post by *jnauth »

Hi Fla$her,
will insert you solution with the /ndl /nfl /njh /njs Parameter Set in a Buttonbar, where I want to timestamp only subfolders with a certain (low) depth. At the moment I didn´t see any performance issues without using your parameter set.

Have to correct my post before. I inserted the now %S1 as added parameter.
This makes sure that the first item will be taken in case of Multiselection of Foldersnamens with the Cursor. Just %S was working also if only one directory was selected. But the %S1 handles also multi-selection and takes definetely the first item.

%N as you suggested is also possible, but will take every time the last item if multiple directories are selected. I prefer then the first item as selection , that´s why %S1 is my preference.

Tried also in the cmd windows your suggestion of list in line.

But robocopy /e /timfix /copy:t /dcopy:t "d:\Source\ " d:\Dest\ " "Dir1" "Dir2" doesn´t work. It looks like that Robocopy supports as line list behind source and target only a line list of filenames, bou not a line list of directory names.
Fla$her
Power Member
Power Member
Posts: 2882
Joined: 2020-01-18, 04:03 UTC

Re: Copy Timestamp Feature (only for marked directories)

Post by *Fla$her »

jnauth wrote: 2025-02-15, 01:39 UTCAt the moment I didn´t see any performance issues without using your parameter set.
To understand, you need to conduct tests with a time counter. Users are often deceived by their own feelings during long-term operations.
jnauth wrote: 2025-02-15, 01:39 UTCThis makes sure that the first item will be taken
But you didn't write about the first item: "only for the selected Folder under the Cursor."
jnauth wrote: 2025-02-15, 01:39 UTC%N as you suggested is also possible, but will take every time the last item if multiple directories are selected.
No. %N only applies to the item under the cursor, according to the quote in quotation marks.
jnauth wrote: 2025-02-15, 01:39 UTCTried also in the cmd windows your suggestion of list in line.
This was not a suggestion, it was a clarification of the list of files you wrote about ("but since Robocopy can´t be feed with a Filelist"). This has nothing to do with the selected folders.

To process folders with the same name, you need a loop operation, for example:
Command: %comspec% /q/c for %d in
Parameters: ("%S") do if exist "%%~d\" if exist "%T%%~d\" >nul robocopy "%P%%~d" "%T%%~d" /e /timfix /copy:t /dcopy:t /ndl /nfl /njh /njs
Overquoting is evil! 👎
jnauth
Junior Member
Junior Member
Posts: 18
Joined: 2009-07-05, 22:38 UTC

Re: Copy Timestamp Feature (only for marked directories)

Post by *jnauth »

Hi Fla$her,
that´s brilliant. Your solution is really a masterpiece. Thank you very much.

Don`t worry also, of course I will include your performance parameters of your solution :D
I set my final set up in my TC and took your final solution above. And I can advice other TC User to use your solution because it is really performant and adding an nice extra Feature to TC.

Let me please ask still two questions about your solution:
1. Why did you add in the command the "if exist "%%~d\" if exist "%T%%~d\" >nul" and redirect the result first to the NUL device?
(what output you want to suppress?)

2. And why are the to 'if clauses' in that sequence integrated in your solution?
(why checking first if Source with directory name exist followed by another check if Target with same directory name exist? I tried
your solution with the two if´s and it is working alos but cause you are the Mastermind I am sure there was an important reason for
you to add that in this way).

Thanks for explaining and best regards.
Fla$her
Power Member
Power Member
Posts: 2882
Joined: 2020-01-18, 04:03 UTC

Re: Copy Timestamp Feature (only for marked directories)

Post by *Fla$her »

2jnauth
1-2. To exclude selected files, some unprintable characters from robocopy and false copy attempts to non-existent folders on the target panel.

You're welcome.
Overquoting is evil! 👎
sa16
Senior Member
Senior Member
Posts: 303
Joined: 2021-09-10, 07:15 UTC

Re: Copy Timestamp Feature (only for marked directories)

Post by *sa16 »

2jnauth
It is possible and so.
usercmd.ini:

Code: Select all

[em_robocopy_times]
cmd=robocopy
param=/ndl /nfl /njh /njs /e /copy:t /dcopy:t /xl "%P " "%T " /xd %P%S /xf %P%S
iconic=1
Button:

Code: Select all

TOTALCMD#BAR#DATA
cm_GoToFirstEntry,cm_GoToPrev,cm_ExchangeSelBoth,em_robocopy_times,cm_ExchangeSelBoth,cm_GoToNextSelected

wcmicons.dll,7
Transfer timestamps selected objects from source directory to target directory
jnauth
Junior Member
Junior Member
Posts: 18
Joined: 2009-07-05, 22:38 UTC

Re: Copy Timestamp Feature (only for marked directories)

Post by *jnauth »

Hi sa16,
and sorry for late reply. Thx very much for your solution as well. Also very tricky and it works perfect.

Your solution includes selected directories and files as well, which are bith processed for the timestamping. This is also a very good and quick solution, if both have to be timestamped.

Even that my Use case is more just the Timestamping of Directories, the combined solution is also very valuable.

So you solution and the solution of Fla$her are really good enhancement for Total Commander and I appreciate a lot the help of both of you in this issue I had.

And I am sure some other TC users might integrate and use them as well in their TC Installation.

Best regards,
jnauth
sa16
Senior Member
Senior Member
Posts: 303
Joined: 2021-09-10, 07:15 UTC

Re: Copy Timestamp Feature (only for marked directories)

Post by *sa16 »

2jnauth
Check the usefulness or harm of using the /xl parameter: without it, a missing subfolder structure is created in the target folder from the source folder (only with a zero size).
jnauth
Junior Member
Junior Member
Posts: 18
Joined: 2009-07-05, 22:38 UTC

Re: Copy Timestamp Feature (only for marked directories)

Post by *jnauth »

Hi sa16,
I inserted alrerady the /xl parameter in my customized solutions in the past days.

The /xl parameter helps also in case the focus is set accidentally to wrong Source folder and the Buttonbar robocopy solution is executed. Then without /xl the Source Trre with the empty subfolders would be created in the Target --> what can be prevented in an excellent way with the /xl parameter and nothing happens by accident.

But thanks for your hint anyway.

Will post tomorrow my 5 Timestamping solutions to support my Use Cases - all based on the Solutions of you, Fla$her an Dalai and the fruitful discussion and excellent solutions and ideas provided by all of you.

At the end thes enabled to enhance TC and its already great capabilities by another good feature regarding Timestamping. And some users in the TC Community might need them and can implement&adapt them easily by themselves.
Post Reply