Copy folder name w/o the "\"

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
gezgin
Junior Member
Junior Member
Posts: 36
Joined: 2009-05-16, 07:58 UTC
Location: Izmir, Turkey

Copy folder name w/o the "\"

Post by *gezgin »

[TC 64 bit / Win10 all updates in place]
When I copy a folder's name to the clipboard using the "Copy filenames to clipboard" function (for which I've put a button on the Button Bar) TC includes a "\" at the end of the name that goes into the clipboard. Is there a way to keep that "\" from being picked up? My current workaround is to right-click on the folder, select "Rename" and manually copy only the part of the name (the part w/o the final "\") that I want. I need to do this sort of thing a lot. Is there a simpler way?

TIA
--
rlb
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Copy folder name w/o the "\"

Post by *Stefan2 »

- you can activate (focus) the address bar and next copy the path , just without selecting the last sign
- you could create a button to execute an kind of script* to remove the last sign and copy the result to the clipboard


*) Batch / PowerShell / AutoHotkey / or a tool like Lefteous lst2clip





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

Re: Copy folder name w/o the "\"

Post by *petermad »

2gezgin
This button should do it:

Code: Select all

TOTALCMD#BAR#DATA
%COMSPEC% /C
echo %N| clip
wcmicons.dll,45
Copy file name or folder name (whitout backslash) to clipboard

1
-1
To 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".


You can also make an em_command in you usercmd.ini file like this:

Code: Select all

[em_CopyNameToClipboardNoBackslash]
cmd=%COMSPEC% /C
param=echo %N| clip
button=wcmicons.dll,45
menu=Copy file name or folder name (whitout backslash) to clipboard
iconic=1

And then assign for example the shortcut Ctrl+Shift+C to the command in your wincmd.ini file:

Code: Select all

[Shortcuts]
CS+C=em_CopyNameToClipboardNoBackslash
Last edited by petermad on 2021-08-30, 14:41 UTC, edited 2 times in total.
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
User avatar
gezgin
Junior Member
Junior Member
Posts: 36
Joined: 2009-05-16, 07:58 UTC
Location: Izmir, Turkey

Re: Copy folder name w/o the "\"

Post by *gezgin »

Petermad:
That is very cool. Thanks so much!

Thanks also Stefan2 for your suggestion. I was just about to explore Lefteous when I saw Petermad's quick fix.
--
Izmirli Bob
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Copy folder name w/o the "\"

Post by *petermad »

2gezgin

If you have made the em_CopyNameToClipboardNoBackslash command, you can also alternatively use that for the button command:

Code: Select all

TOTALCMD#BAR#DATA
em_CopyNameToClipboardNoBackslash

wcmicons.dll,45
Copy file name or folder name (whitout backslash) to clipboard

0
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