Copy Timestamp Feature (only for marked directories)
Moderators: petermad, Stefan2, white, Hacker
Re: Copy Timestamp Feature (only for marked directories)
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.
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.
Re: Copy Timestamp Feature (only for marked directories)
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 UTCAt the moment I didn´t see any performance issues without using your parameter set.
But you didn't write about the first item: "only for the selected Folder under the Cursor."
No. %N only applies to the item under the cursor, according to the quote in quotation marks.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.
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! 👎
Re: Copy Timestamp Feature (only for marked directories)
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
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.
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

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.
Re: Copy Timestamp Feature (only for marked directories)
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.
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! 👎
Re: Copy Timestamp Feature (only for marked directories)
2jnauth
It is possible and so.
usercmd.ini:
Button:
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
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
Re: Copy Timestamp Feature (only for marked directories)
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
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
Re: Copy Timestamp Feature (only for marked directories)
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).
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).
Re: Copy Timestamp Feature (only for marked directories)
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.
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.