renaming a file using hotkey or directory hotlist

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
junggle
Junior Member
Junior Member
Posts: 4
Joined: 2013-08-05, 21:43 UTC
Location: Czech Republic
Contact:

renaming a file using hotkey or directory hotlist

Post by *junggle »

hi all

how can i rename a file under cursor using a hotkey or directory hotlist?

e.g.
pressing "ctrl+shift+F1" renames "file.ext" to "file_1.ext"
pressing "ctrl+shift+F2" renames "file.ext" to "file_2.ext"

any help appreciated.
love to learn, love to share.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Configuration - Misc., assign theese hotkeys for newly created commands in usercmd.ini section:

Code: Select all

Command: %ComSpec% /c
Parameters: "ren "%P%O.%E" "%O_1.%E""
Run minimized: Yes

Code: Select all

Command: %ComSpec% /c
Parameters: "ren "%P%O.%E" "%O_2.%E""
Run minimized: Yes
User avatar
junggle
Junior Member
Junior Member
Posts: 4
Joined: 2013-08-05, 21:43 UTC
Location: Czech Republic
Contact:

Post by *junggle »

thanks a bunch :D

there is no usercmd.ini anywhere in my install path.
should i create it in my tc dir?

why are there two quotation marks at the end ("%O_1.%E"")?

also, is there any documentation for this functionality,
(meaning of the variables like %P, %O ...)?

cheers
love to learn, love to share.
User avatar
nsp
Power Member
Power Member
Posts: 1954
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

junggle wrote:there is no usercmd.ini anywhere in my install path.
should i create it in my tc dir?
If you use the command browser - cm_commandbrowser and choose usercmd.ini at bottom of left listview, the file will be created automatically if you add a new command using new !
junggle wrote:why are there two quotation marks at the end ("%O_1.%E"")?
Because there is one before ren... "ren "%P%O.%E" "%O_1.%E""
junggle wrote:also, is there any documentation for this functionality,
(meaning of the variables like %P, %O ...)?

cheers
If you edit add a button or a user command, you can find a [help] button ... you can also access it from main help choosing Dialog box: Configuration - Change button bar
User avatar
junggle
Junior Member
Junior Member
Posts: 4
Joined: 2013-08-05, 21:43 UTC
Location: Czech Republic
Contact:

Post by *junggle »

thanks!!!
it works smoothly :D
love to learn, love to share.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

If you open configuration dialog at Misc. page and click chose command button, you'll see mentioned command browser with usercmd.ini section of commands where user commands may be created.

Extra pair of double quotes in parameter line is the pain of cmd.exe which likes to remove them so sometimes it causes problems (if e.g. you specify quoted path to program and quoted path to file it will remove first and last quotes making command invalid) so it is easier to put them always instead of thinking whether they're needed.
User avatar
junggle
Junior Member
Junior Member
Posts: 4
Joined: 2013-08-05, 21:43 UTC
Location: Czech Republic
Contact:

Post by *junggle »

thanks.

i would like to create one more hotkey for moving a file to parent directory

what parameters should i use?
love to learn, love to share.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Code: Select all

Parameters: "move "%P%O.%E" "%P\..\%O.%E""
You can also do both move and rename at once with move command.
Post Reply