How to create a shortcut to append the date to a file name?
Moderators: Hacker, petermad, Stefan2, white
How to create a shortcut to append the date to a file name?
Is it possible (maybe via Redifine hotkeys) to define a keyboard
shortcut to append the current date to a filename? I need to do
this everyday many times. E.g. file.txt => file_2014-11-07.txt
shortcut to append the current date to a filename? I need to do
this everyday many times. E.g. file.txt => file_2014-11-07.txt
Without using batch:
- Create a template in the Multi-Rename Tool with mask
- Save the template (F2) as "Add-Y-M-D"
- Create a button with command:
With batch:
Save this as "Add_Date.cmd" and put it on a button with parameters
Remove the two mentioned commands if it looks right and set "Run minimized" in the button options.
*edit: To use it with a hotkey you have to create an em_ user command which uses the same options as the buttons.
- Create a template in the Multi-Rename Tool with mask
Code: Select all
[N]_[Y]-[M]-[D]
- Create a button with command:
Code: Select all
MULTIRENAME Add-Y-M-D
Save this as "Add_Date.cmd" and put it on a button with parameters
Code: Select all
"%F" "%P" "%T"
Code: Select all
@echo off
setlocal enabledelayedexpansion
rem Button Parameter "%F" "%P" "%T"
set tc_lst=%1
set tc_src=%2
set tc_dst=%3
rem For date format dd.mm.yyyy
set d=%date:~0,2%
set m=%date:~3,2%
set y=%date:~6,4%
set string=_%y%-%m%-%d%
if -%3==- echo First parameter must be filelist path, second and third - source and target path. && pause && goto :EOF
for /F "usebackq delims=" %%I in (%tc_lst%) do (
rem Remove "echo" for production
echo ren %%~fI %%~nI%string%%%~xI
)
rem Remove "pause" for production
pause
cls
endlocal
*edit: To use it with a hotkey you have to create an em_ user command which uses the same options as the buttons.
Can I use the today date (format YMD) in MRT? How?
NOW v0.1 (W) StatusQuo 2008, small VBS-script for TC content plugin SCRIPT.WDX
www.ghisler.ch/board/viewtopic.php?t=18763
NOW v0.1 (W) StatusQuo 2008, small VBS-script for TC content plugin SCRIPT.WDX
www.ghisler.ch/board/viewtopic.php?t=18763
re
for example for *.log files in current directory this batch file is working:
REN *.LOG "* %Date:/= % %Time::=.%.*log"
maybe somebody would be able use it to create button (command in tray in TC) to rename file on that cursor on panel in TC is located ...
----------
the mode of date (and time) sorting is possible to set in Control panel - Regional settings ...
REN *.LOG "* %Date:/= % %Time::=.%.*log"
maybe somebody would be able use it to create button (command in tray in TC) to rename file on that cursor on panel in TC is located ...
----------
the mode of date (and time) sorting is possible to set in Control panel - Regional settings ...