Copy file path or file name to clipboard
Moderators: petermad, Stefan2, white, Hacker
-
- Junior Member
- Posts: 3
- Joined: 2007-12-11, 20:29 UTC
Copy file path or file name to clipboard
Hi all,
Sort of searched the forums, but havent found the answer yet. Is there a way in TC to (quickly) copy the path and file name of a selected file or folder to the clipboard? This makes it easy to paste a filename (with path) when (eg) attaching files to an email, or any situation where a click on a file is not enough to do what you want to do - attach a database file to a SQL server etc etc etc
You can press Ctrl-Shift-Enter to add the path and file name of a selected file into the command box at the bottom of TC. Then you still have to select it and press Ctrl-C to copy it. To copy another file's path, you have to first erase the command box, then Ctrl-Shift-Enter, then select it, copy it. Way too slow. Could there be a simple menu command or hotkey to do this?
Thanks
Dave
Sort of searched the forums, but havent found the answer yet. Is there a way in TC to (quickly) copy the path and file name of a selected file or folder to the clipboard? This makes it easy to paste a filename (with path) when (eg) attaching files to an email, or any situation where a click on a file is not enough to do what you want to do - attach a database file to a SQL server etc etc etc
You can press Ctrl-Shift-Enter to add the path and file name of a selected file into the command box at the bottom of TC. Then you still have to select it and press Ctrl-C to copy it. To copy another file's path, you have to first erase the command box, then Ctrl-Shift-Enter, then select it, copy it. Way too slow. Could there be a simple menu command or hotkey to do this?
Thanks
Dave
-
- Junior Member
- Posts: 3
- Joined: 2007-12-11, 20:29 UTC

My idea is an icon that copy the path (suggestion TC 7.03)
http://www.geocities.com/cdavidrp/images/copyPath.gif
Last edited by CDR on 2007-12-11, 21:38 UTC, edited 1 time in total.
You can make your own icons in the buttonbar. What is wrong with that?CDR wrote:![]()
My idea is an icon that copy the path
http://www.geocities.com/cdavidrp/images/copyPath.gif
Stitscher
I have to copy filenames and filepaths very often. I made the following associations through Configuration/Option/Misc/Hotkey:
cm_CopyNamesToClip with F11
cm_CopyFullNamesToClip with F12
This gives me one tap access to copying to clipboard one file or any number of files I have selected. This is fast convenient. Of course you can associate any number of other key combinations to suite your preference.
cm_CopyNamesToClip with F11
cm_CopyFullNamesToClip with F12
This gives me one tap access to copying to clipboard one file or any number of files I have selected. This is fast convenient. Of course you can associate any number of other key combinations to suite your preference.
Buttons---
2DaveBoltman
Hello !
• The Stischer's (menu) and sorcar's (keys) solutions are nice, but since you wish icons,
you could set three buttons in the button-bar like I use here with the commands :
cm_CopyNamesToClip
cm_CopyFullNamesToClip
cm_CopyNetNamesToClip
- A small ZIP containing three meaningful icons is available HERE (24² with pastel BGs, could do the trick to test…)
KR
Claude
Clo

• The Stischer's (menu) and sorcar's (keys) solutions are nice, but since you wish icons,
you could set three buttons in the button-bar like I use here with the commands :
cm_CopyNamesToClip
cm_CopyFullNamesToClip
cm_CopyNetNamesToClip
- A small ZIP containing three meaningful icons is available HERE (24² with pastel BGs, could do the trick to test…)

Claude
Clo
#31505 Traducteur Français de T•C French translator Aide en Français Tutoriels Français English Tutorials
-
- Junior Member
- Posts: 7
- Joined: 2016-09-20, 07:19 UTC
PowerShell:cm_CopyFullNamesToClip but only parts of the path
We have to utilize a external tool to modify the strings of each path.parakovsky wrote:we just need folder1/file.ext for our purpose, am sure it can be done, but how?
For both examples use a tool like PowerShell, VBS or AHK to manipulate the file or clipboard content.
Example 1:
- use TCs %L parameter to save the name of selected files to a temporary file.
- use a scripting tool to manipulate that file
- copy the file content to the clipboard
Here is one of many post about that: http://ghisler.ch/board/viewtopic.php?p=291870#291870
Example 2:
- utilize cm_CopyFullNamesToClip
- manipulate the clipboard directly by using a scripting tool
Here is one of many post about that: http://www.ghisler.ch/board/viewtopic.php?t=29019
For both ways you can create buttons and/or keyboard shortcuts toexecute.
If there is an interest for this, maybe someone can point you to the right direction.
EDIT (lunch break

for ex:
FROM:
C:\folder\folder1\file.ext
TO:
\folder1\file.ext
USE TC Button Setting:
CMD : PowerShell
PARA: TYPE '%L'|Foreach{$_ -Replace('^.+(\\.+?\\.+)$','$1')}|clip
Or rather for your FTP case with forward slashes:
FROM:
C:/folder/folder1/file.ext
TO:
/folder1/file.ext
TYPE '%L'|Foreach{$_ -Replace('^.+(/.+?/.+)$','$1')}|clip
Explanations:
TYPE '%L' | Foreach{ $_ -Replace('^.+(\\.+?\\.+)$' , '$1') } | clip
TYPE = DOS command
'%L' = TCs parameter. Open a button like to modify, but press F1-key to read the help.
|Foreach{...} = PowerShell syntax to read each line from TCs '%L' temp file
$_ = current processed line with path information from TCs '%L' temp file
-Replace( '^.+(\\.+?\\.+)$', = RegEx Replace to match last two path elements only
'$1') = and only use (replace by) that matched part
}| = PowerShell syntax
clip = Windows Clip.exe
-
- Junior Member
- Posts: 7
- Joined: 2016-09-20, 07:19 UTC
Re: PowerShell:cm_CopyFullNamesToClip but only parts of the
Thanks, and it looks like a lot of ground needs to be covered, and one post is in Deutsch, which I have A+ at school but haven't been using for a long time.
Stefan2 wrote:We have to utilize a external tool to modify the strings of each path.parakovsky wrote:we just need folder1/file.ext for our purpose, am sure it can be done, but how?
....