copy file's short name (DOS 8.3) to clipboard with full path

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

2white
As I tried (but failed) to explain above, my solution does not work for several selected files.
Actually you have got success in your explanation. That's way I've tried to ask in my last post, is there any other solution for this task.
This has to do with copying file name including path. I have included a link in my message above to a bug report where you can find more information about this.
I had already viewed that topic with your discussion with Christian on the subject, whether this is a bug or not. Well, it is not a bug, fine. But it does not however bring us closer to the solution.
You can find more information about %P, %p, %l, %L in Total Commander's help. These variables must be used in the Parameters field. Creating a button with "cd" in the Command field and "%p" in the Parameters field will allow you to go to the current path in short naming notation.
Yes, I see now your idea, thanks. However here is a bit more movements to get the aim, than one should expect for such power tool as TC is and for such extremely simple task.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

leopoldus wrote:Well, the only small sub-case still is not solved is copying several selected filenames in 8.3 format without paths.
Okay, another approach: List2Clipboard

Button to copy path and names:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\Lst2Clip\Lst2Clip.exe
/L:"%l"
%COMMANDER_PATH%\Addons\Lst2Clip\Lst2Clip.exe
Copy DOS-names (including path)


-1
Button to copy only the names:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Addons\Lst2Clip\Lst2Clip.exe
/L:"%f"
%COMMANDER_PATH%\Addons\Lst2Clip\Lst2Clip.exe
Copy DOS-names


-1
Regards
Holger

Edit: changed /R:"%p"="" /L:"%l" to /L:"%f"
Last edited by HolgerK on 2013-09-08, 20:05 UTC, edited 1 time in total.
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

2HolgerK
Okay, another approach: List2Clipboard
Thank you! I did always know, that there should be a simple solution, as I'm hardly the first user for TC long history, who needs DOS 8.3 names list. :)
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

leopoldus wrote:Actually you have got success in your explanation. That's way I've tried to ask in my last post, is there any other solution for this task.
You can use the method using nircmd.exe also for copying file names without path. Simply use a different variable e.g. %f instead %l.
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

HolgerK wrote:

Code: Select all

/R:"%p"="" /L:"%l"
That's really funny. :lol:
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Yes. :lol:

I should have read the list of list formats more carefully :D

Regards
Holger
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

2white
You can use the method using nircmd.exe also for copying file names without path. Simply use a different variable e.g. %f instead %l.
Thanks! It will be the alternative to Clp2Lst.
That's really funny.
Excuse me for my ignorance, what is the point here?
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

leopoldus wrote:
That's really funny.
Excuse me for my ignorance, what is the point here?
The point is you can use the variable %f with List2Clipboard too. Simply use:

Code: Select all

/L:"%f"
instead of

Code: Select all

/R:"%p"="" /L:"%l"
It's funny to include paths and then to remove them. ;-)

BTW. You can use any program or script that can copy the contents of a file to clipboard. If you have clip.exe on your system, you can use:
Command: %comspec% /c clip.exe
Parameters: <%f
Last edited by white on 2013-09-08, 21:28 UTC, edited 1 time in total.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

Code: Select all

/R:"%p"=""
/R is the replace option of list2clip
%p is the 8.3 path of the source panel
The command replaces the string %p inside the list with nothing.

It's not necessary to remove the 8.3 path from the List (%l) because TC already provides a list with only the 8.3 filenames (%f)

Furthermore it won't work correct if you are working with search results or branch view.

Code: Select all

/L="%f"
is all you need.

Regards
Holger
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

2white
BTW. You can use any program or script that can copy the contents of a file to clipboard. If you have clip.exe on your system, you can use:
Command: %comspec% /c clip.exe
Parameters: <%f
Again I miss the point. Which way copying the content of a file is connected with the subject of the current topic, that is copying filenames to clipboard in short DOS format?
Thanks!
User avatar
white
Power Member
Power Member
Posts: 4622
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

leopoldus wrote:2white
BTW. You can use any program or script that can copy the contents of a file to clipboard. If you have clip.exe on your system, you can use:
Command: %comspec% /c clip.exe
Parameters: <%f
Again I miss the point. Which way copying the content of a file is connected with the subject of the current topic, that is copying filenames to clipboard in short DOS format?
Well the method we discussed is storing all file names in a file and passing the file name to an external program. As explained in the help:
"%L, %l, %F, %f, %D, %d, %WL, %WF, %UL, %UF create a list file in the TEMP directory with the names of the selected files and directories, and appends the name of the list file to the command line. The list is deleted automatically when the called program quits."

What did you think "C:\Tools\NirSoft\nircmd.exe clipboard readfile" meant?
Post Reply