Create a hotkey to do (multi) rename(s) and exits after done

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Create a hotkey to do (multi) rename(s) and exits after done

Post by *petermad »

Is there anyway to select one (or more) file(s) in a panel and press F5 (or F6 for Move) and do the Copy (or Move) immediately? (to the other panel without the confirmation prompt?). It can be with another function key or better still redefine F5 and F6 to do the Copy or Move without the confirmation dialog?
Not with TC commands, but you could make TC start a DOS script:

Code: Select all

[em_copynoprompt]
cmd=%COMSPEC% /C
param=if not exist "%P" (echo •) else if not exist "%T" (echo •) else if exist %Y%P%S1\* (echo •) else if exist "%T%O" (echo •) else chcp 65001 && %%COMSPEC%% /C for /F "usebackq delims=" %%n in (`type %WL`) do if not exist "%%n\*" xcopy "%%n" "%T" /H /R /K /Y
menu=Copy marked files to opposite panel without asking qustions
iconic=1

Code: Select all

[em_movenoprompt]
cmd=%COMSPEC% /C
param=if not exist "%P" (echo •) else if not exist "%T" (echo •) else if exist %Y%P%S1\* (echo •) else if exist "%T%O" (echo •) else chcp 65001 && %%COMSPEC%% /C for /F "usebackq delims=" %%n in (`type %WL`) do if not exist "%%n\*" xcopy "%%n" "%T" /H /R /K /Y && %%COMSPEC%% /C for /F "usebackq delims=" %%n in (`type %WL`) do if not exist "%%n\*" del "%%n" /F /A
menu=Move marked files to opposite panel without asking qustions
iconic=1
For security reasons the commands will NOT copy directories. The commands will only work where DOS works, hence not copying/moving to or from archives and FTP-sites. Hidden and system files will be copied/moved and overwritten without warning.

The character after the echo's in the code might get replaced when copying from the browser, therefore I have put the code up for download: https://madsenworld.dk/tcmd/copy-move-noprompt.zip

I do not recommend assigning these commands to F5 and F6 - you will need those for other things - but maybe to Ctrl+Shift+F5 and Ctrl+Shift+F6, then you don't take already used shortcuts, and you don't just accidentally execute the commands.
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.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply