Keyboard shortcut for inserting date when editing file names
Moderators: white, Hacker, petermad, Stefan2
Keyboard shortcut for inserting date when editing file names
I often put the current date in filenames and would really like to have a keyboard shortcut for inserting the date (formatted according to Windows' regional settings) when editing a file name. Like in Excel, when you press CTRL+SHIFT+, (comma). It's a real time saver in Excel, and would be in TC too!
Thanks for an amazing application!
Thanks for an amazing application!
Re: Keyboard shortcut for inserting date when editing file names
Alternatives
You know you can create file and folder by utilizing Shift+F4 and F7 with current time stamp? (newer TC versions)
<My folder name-[Y]-[M]-[D]-[hms]
Also you can create user defined commands to create file and folder with current time stamp by just a click or a keyboard shortcut?
I also have "touchMe" scripts to add timestamps to already existing files.
For really "to insert" into the Shift+F4 / F7-dialogs you can utilize AutoHotkey.
SendTimestamp.ahk
Code: Select all
;FormatTime, OutputVar [, YYYYMMDDHH24MISS, Format]
FormatTime, OutputVar , ,yyyy-MM-dd-HHmmss
;Execute on 'Win+N ' key press
#n::
Send %OutputVar%
Re: Keyboard shortcut for inserting date when editing file names
2cyberzip
Maybe that will help you too: SHIFT+U <ENTER> (Rename files)
Define your desired date format:
(If you want to assign a shortcut to a command, you must first create an em_command).
Maybe that will help you too: SHIFT+U <ENTER> (Rename files)
Define your desired date format:
- Files - Multi-Rename Tool... Ctrl+M --> opens MUT (Multi-Rename Tool)
- Rename mask: file name --> [Y]-[M]-[D]_[N] ... define your desired format ...
- F2 Load/save settings > Save settings: e.g. YYYY-MM-DD_Filename, OK, Close
(If you want to assign a shortcut to a command, you must first create an em_command).
- Type in: cm_CommandBrowser <ENTER> in command line of TC
- Type in: multirename in the field "Filter:" to determine the internal commands with parameters
- Clear field "Filter:"
- Click on usercmd.ini (under Category)
- Click on button "New..." - new command name, e.g.: em_YYYY-MM-DD_Filename
- OK, Command: MULTIRENAME em_YYYY-MM-DD_Filename
- Tooltip: MULTIRENAME em_YYYY-MM-DD_Filename|viewtopic.php?f=14&t=50860
- OK, OK
- Menu "Configuration" - "Options..." - "Misc." - Redefine hotkeys (Keyboard remapping)
- Choose your hotkey(s) by clicking the appropriate field(s), e.g. [x] Shift + U - "Default command (no remapping)" is shown then
- Click on the magnifying glass to the right - click on "usercmd.ini" - choose your em_command: em_YYYY-MM-DD_Filename - OK
- IMPORTANT: click on the green checkmark! - OK - FINISHED!
Re: Keyboard shortcut for inserting date when editing file names
2tuska
MRT creates a date based on the modification date of the file, not the current date!
Regards
Holger
MRT creates a date based on the modification date of the file, not the current date!
Regards
Holger
Make our planet great again
Re: Keyboard shortcut for inserting date when editing file names
Ahh, yes, you are right!
Sorry!
(To my apology: I usually store files or create files and execute the shortcut immediately on the same day.)
Regards
Karl
Last edited by tuska on 2018-08-27, 09:46 UTC, edited 2 times in total.
- ghisler(Author)
- Site Admin
- Posts: 48124
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Keyboard shortcut for inserting date when editing file names
Actually you can use placeholders [T1], [T2] and [T3] to control which date is inserted. From the help:
[T1] After this position, use last modification date/time from renamed file for all date/time fields (default).
Note: These are just switches! Use them with the other time placeholders, e.g. [T1][YMD] [hms]
[T2] After this position, use current date/time (when rename dialog was opened)
[T3] After this position, use current date/time (when rename options were last changed)
[T1] After this position, use last modification date/time from renamed file for all date/time fields (default).
Note: These are just switches! Use them with the other time placeholders, e.g. [T1][YMD] [hms]
[T2] After this position, use current date/time (when rename dialog was opened)
[T3] After this position, use current date/time (when rename options were last changed)
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Keyboard shortcut for inserting date when editing file names
The modification date is more useful for this purpose.
I use a shell extension (ShimExt) which does rename or copy with the modification date and find it very useful.
Its easier to handle using a context menu compared to using the MRT.
Also it can be customized for date format and what date should be used.
https://www.8charmax.com/shimext/
Windows 11 Home x64 Version 23H2 (OS Build 22631.3527)
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
TC 11.03 x64 / x86
Everything 1.5.0.1375a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.78
QAP 11.6.3.3 x64
Re: Keyboard shortcut for inserting date when editing file names
Old thread - but was indeed very usefull for me, this is the first time I'm extending the functionalty of TCM (should have done this ages ago)
Here's my notes (replicating most of alredy presented here...) - hope they're used by others that like to prepend their filenames with the current data+time (and also remove it in order to update it). Org mode have a great feature for editing these kind of data, but that's another story.
How to quickly prepend a filename with a time+date stamp
Create two settings in the MultiFileRename menu (Ctrl+M, F2)
Create a custom command
Add a generic shortcut for the custom command
Now it's possible to prepend the date+time stamp from the "normal file-window:
AND directly in the Multi File Rename window (eg for removal of the date time stamp)
To ADD the <DateTime> stamp
To REMOVE the <DateTime> stamp
Note to self: The config ends up here:
Source: viewtopic.php?t=50860
Here's my notes (replicating most of alredy presented here...) - hope they're used by others that like to prepend their filenames with the current data+time (and also remove it in order to update it). Org mode have a great feature for editing these kind of data, but that's another story.
How to quickly prepend a filename with a time+date stamp
Create two settings in the MultiFileRename menu (Ctrl+M, F2)
Code: Select all
1. Prepend _YYYY-MM-DD_hhmmss _
Rename Mask : [=tc.writedate.Y-M-D_hms] [N]
RegEx : N/A
Code: Select all
2. Remove _YYYY-MM-DD_hhmmss_ from start
Rename Mask : [N]
Search for : (\d{4})-(\d{2})-(\d{2})_(\d{6})( +)(.*)
RegEx : Enabled
Create a custom command
Code: Select all
1. Launch cm_CommandBrowser
2. In Category select "usercmd.ini"
3. Create a new entry "em_prepend_date_time_to_filename"
Command: "MULTIRENAME 1. Prepend _YYYY-MM-DD_hhmmss _"
Tooltip: "Prepend Date & Time to the filename"
Add a generic shortcut for the custom command
Code: Select all
1. Select Configuration -> Options -> Misc.
2. Select hotkey = CTRL+ALT+D
3. Click search button
4. In Category select "usercmd.ini"
5. Select the just created command "em_prepend_date_time_to_filename"
6. Click OK
7. Click the green tick mark
8. Click OK
Now it's possible to prepend the date+time stamp from the "normal file-window:
Code: Select all
1. Select files
2. Press CTRL+ALT+D
3. Press OK
4. Press ESC
AND directly in the Multi File Rename window (eg for removal of the date time stamp)
To ADD the <DateTime> stamp
Code: Select all
1. Select files
2. CTRL+M => Launch Multi Rename Files
3. F2 => Load settings
4. 1 => Select preset "1. Prepend _YYYY-MM-DD_hhmmss _"
5. Enter => Perform the rename
6. F5 => Refresh the view to see the renamed files
To REMOVE the <DateTime> stamp
Code: Select all
1. Select files
2. CTRL+M => Launch Multi Rename Files
3. F2 => Load settings
4. 2 => Select preset "2. Remove _YYYY-MM-DD_hhmmss_ from start"
5. Enter => Perform the rename
6. F5 => Refresh the view to see the renamed files
Note to self: The config ends up here:
Code: Select all
%APPDATA%\Roaming\GHISLER\usercmd.ini
%APPDATA%\Roaming\GHISLER\wincmd.ini
Source: viewtopic.php?t=50860
Re: Keyboard shortcut for inserting date when editing file names
A quick way of inserting the date in the file name for single files is this Button:
Code: Select all
TOTALCMD#BAR#DATA
cm_RenMov
/GT="%|$DATE:Y-M-D_h.m.s|_%N"W="%N"
WCMICONS.DLL,32
Prepend name of the file under the cursor with current date and time
Requires TC 11.0 or newerTo make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Keyboard shortcut for inserting date when editing file names
2TvE
So not more convenient?
Code: Select all
"MULTIRENAME 1. Prepend _YYYY-MM-DD_hhmmss _"
Code: Select all
"MULTIRENAME == 1. Prepend _YYYY-MM-DD_hhmmss _"
12.04.22 Release Total Commander 10.50 beta 1
28.02.22 Added: command MULTIRENAME==<settings> with two equal signs now starts renaming immediately and closes the dialog if successful (32/64)
Re: Keyboard shortcut for inserting date when editing file names
It works fine, but you are right the W="%N" part is not necessary - it was left over from tests where I tried to make it work for several files. And of course we need %Q - I just never use spaces in file names so i forgot about it.
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Keyboard shortcut for inserting date when editing file names
2petermad
Just not as in the examples:I tried to make it work for several files.
Code: Select all
TOTALCMD#BAR#DATA
cm_Renmov
/GT="???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????_%|$DATE:Y-M-D_h-m-s|.*"
WCMICONS.DLL,32
Re: Keyboard shortcut for inserting date when editing file names
2sa16
Exactly - I don't think it is possible using cm_Renmov without any third party programs.Just not as in the examples:
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: Keyboard shortcut for inserting date when editing file names
@sa16
Awesome - I just came back to post an update to my config and learned about `==´
I'll post the complete guide here
Changes
- Addedd `==´ for commands to take effect immediately
- Added shortcut for prepending DATE only
Create three settings in the MultiFileRename menu (Ctrl+M, F2)
First
Second
Third
Create two custom commands
Add generic shortcuts for the custom commands
OR add these two lines to %APPDATA%/GHISLER/wincmd.ini
Now it's possible to prepend the date/date+time stamp from the "normal" file-window:
AND directly in the Multi File Rename window (eg for removal of the date time stamp)
(I could make a direct shortcut to the "remove", but I think my main use case is to ADD, not remove, the data/time stamp...)
To ADD the <Date> stamp
To ADD the <DateTime> stamp
To REMOVE the <DateTime> stamp
Note to self: The config ends up here:
Source: viewtopic.php?t=50860
2024-02-25 1213 UPDATE
Changed the two snippets from to as I just learned that the former results in the timestamp from when the file was created (or modified?) and I want to get the Wall Clock Time (which [T2] is so kind as to give me)
Awesome - I just came back to post an update to my config and learned about `==´
I'll post the complete guide here
Changes
- Addedd `==´ for commands to take effect immediately
- Added shortcut for prepending DATE only
Create three settings in the MultiFileRename menu (Ctrl+M, F2)
First
Code: Select all
"0. Prepend _YYYY-MM-DD _"
Rename Mask : [T2][Y]-[M]-[D] [N]
RegEx : N/A
Code: Select all
"1. Prepend _YYYY-MM-DD_hhmmss _"
Rename Mask : [T2][Y]-[M]-[D]_[h][m][s] [N]
RegEx : N/A
Code: Select all
"2. Remove _YYYY-MM-DD_hhmmss_ from start"
Rename Mask : [N]
Search for : (\d{4})-(\d{2})-(\d{2})(_\d{6}){0,1}( +)(.*)
RegEx : Enabled
Create two custom commands
Code: Select all
1. Launch cm_CommandBrowser
2. In Category select "usercmd.ini"
3. Create a new entry "em_prepend_date_to_filename"
Command: "MULTIRENAME == 0. Prepend _YYYY-MM-DD _"
Tooltip: "Prepend Date to the filename"
4. Create a new entry "em_prepend_date_time_to_filename"
Command: "MULTIRENAME == 1. Prepend _YYYY-MM-DD_hhmmss _"
Tooltip: "Prepend Date & Time to the filename"
Code: Select all
1. Select Configuration -> Options -> Misc.
2. Select hotkey = CTRL+ALT+D
3. Click search button
4. In Category select "usercmd.ini"
5. Select the just created command "em_prepend_date_to_filename"
6. Click OK
7. Click the green tick mark
8. Click OK
9. Select hotkey = CTRL+ALT+SHIFT+D
10. Click search button
11. In Category select "usercmd.ini"
12. Select the just created command "em_prepend_date_time_to_filename"
13. Click OK
14. Click the green tick mark
15. Click OK
Code: Select all
[Shortcuts]
CAS+D=em_prepend_date_time_to_filename
CA+D=em_prepend_date_to_filename
Now it's possible to prepend the date/date+time stamp from the "normal" file-window:
Code: Select all
1. Select files
2a. Press CTRL+ALT+D (for date)
2b. Press CTRL+ALT+SHIFT+D (for date+time)
AND directly in the Multi File Rename window (eg for removal of the date time stamp)
(I could make a direct shortcut to the "remove", but I think my main use case is to ADD, not remove, the data/time stamp...)
To ADD the <Date> stamp
Code: Select all
1. Select files
2. CTRL+M => Launch Multi Rename Files
3. F2 => Load settings
4. 0 => Select preset "0. Prepend _YYYY-MM-DD _"
5. Enter => Perform the rename
6. F5 => Refresh the view to see the renamed files
To ADD the <DateTime> stamp
Code: Select all
1. Select files
2. CTRL+M => Launch Multi Rename Files
3. F2 => Load settings
4. 1 => Select preset "1. Prepend _YYYY-MM-DD_hhmmss _"
5. Enter => Perform the rename
6. F5 => Refresh the view to see the renamed files
To REMOVE the <DateTime> stamp
Code: Select all
1. Select files
2. CTRL+M => Launch Multi Rename Files
3. F2 => Load settings
4. 2 => Select preset "2. Remove _YYYY-MM-DD_hhmmss_ from start"
5. Enter => Perform the rename
6. F5 => Refresh the view to see the renamed files
Note to self: The config ends up here:
Code: Select all
%APPDATA%\Roaming\GHISLER\usercmd.ini
%APPDATA%\Roaming\GHISLER\wincmd.ini
Source: viewtopic.php?t=50860
2024-02-25 1213 UPDATE
Changed the two snippets from
Code: Select all
[=tc.writedate.Y-M-D_hms] [N]
Code: Select all
[T2][Y]-[M]-[D]_[h][m][s] [N]
Last edited by TvE on 2024-02-25, 11:16 UTC, edited 1 time in total.