How to create a hotkey or button to move files this way?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Adams
Junior Member
Junior Member
Posts: 21
Joined: 2011-10-10, 23:31 UTC

How to create a hotkey or button to move files this way?

Post by *Adams »

Is there any way to create a hotkey or button to do this:

after file selection, run the hotkey to move the selected files to a directory like C:\bak\UNIQUE_DIR

UNIQUE_DIR is different every time you run the hotkey. For example, it can be decided by the time when you run it.

If you run the hotkey at October 11, 2012, 08:15, then the directory
C:\bak\2012_1011_0815 would be created, and the selected files would be moved into it. The dir name doesn't have to be 2012_1011_0815, just a unique string is ok.

So any ideas?
User avatar
nsp
Power Member
Power Member
Posts: 1956
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: How to create a hotkey or button to move files this way?

Post by *nsp »

Adams wrote:Is there any way to create a hotkey or button to do this:

after file selection, run the hotkey to move the selected files to a directory like C:\bak\UNIQUE_DIR

UNIQUE_DIR is different every time you run the hotkey. For example, it can be decided by the time when you run it.

If you run the hotkey at October 11, 2012, 08:15, then the directory
C:\bak\2012_1011_0815 would be created, and the selected files would be moved into it. The dir name doesn't have to be 2012_1011_0815, just a unique string is ok.

So any ideas?
If you only have to handle file without extended unicode name, you can use tcbl to handle this:
Download and install tcbl on totalcommander tools folder.
create a user command

Code: Select all

Command: %COMMANDER_PATH%\tools\tcbl\\tcbl.exe
parameters: -q %L set _backup="c:\bak\$T" $; md %%_backup%%  $; cd /d %%_backup%% $( move "$f" "$n"
icon: ???
you will move to a folder named c:\bak\<unixtime> defined in the _backup variable by "c:\bak\$T".
<unixtime> is the number of seconds since midnight January 1, 1970

If you want YYYY_MMDD_HHmmss you can use : $Y_$M$D_$t instead of $T


If you need more readability for your script use tcbl.ini and ask in tcbl forum for help if needed.....
Post Reply