This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

copy file's short name (DOS 8.3) to clipboard with full path
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) Printable version
View previous topic :: View next topic  
Author Message
leopoldus
Senior Member
Senior Member


Joined: 21 Nov 2004
Posts: 221

PostPosted: Sat Sep 07, 2013 9:31 am    Post subject: copy file's short name (DOS 8.3) to clipboard with full path Reply with quote

Could not find any internal command or other solution to copy a file's short name (in DOS-format 8.3) to a clipboard with or without full path.

No a single word in the Manual neither here at forum. Have I missed anything? I can't believe me to be the first, who needs it.
Back to top
View user's profile Send private message
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 2020
Location: Netherlands

PostPosted: Sat Sep 07, 2013 9:46 am    Post subject: Re: copy file's short name (DOS 8.3) to clipboard with full Reply with quote

leopoldus wrote:
Could not find any internal command or other solution to copy a file's short name (in DOS-format 8.3) to a clipboard with or without full path.

Use the new beta and something like this as button command:
Code:
cm_SwitchLongNames,cm_CopyNamesToClip,cm_SwitchLongNames
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8011
Location: Russian Federation

PostPosted: Sat Sep 07, 2013 9:57 am    Post subject: Reply with quote

Using a tool like TCMC of TCFS2 it is possible with any TC version. TCFS2 may also check if long names are enabled before switching it off.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
leopoldus
Senior Member
Senior Member


Joined: 21 Nov 2004
Posts: 221

PostPosted: Sat Sep 07, 2013 2:43 pm    Post subject: Reply with quote

2white
Quote:

Use the new beta and something like this as button command:

I see, thanks. It should work to copy short names without paths.

But what about copying the full path, including short names of the folders?
As far as I know, TC can not copy short names of files immediately after switching from long names format - and visa versa. In order to get the correct path, you need to go through the whole path from the root folder to your file after you switch to alter name format, otherwise you will get some ugly hybrid of long and short names. Am I right?

2MVV
Quote:
Using a tool like TCMC of TCFS2 it is possible with any TC version.

I'll try this tool, thanks.
Back to top
View user's profile Send private message
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 2020
Location: Netherlands

PostPosted: Sat Sep 07, 2013 6:34 pm    Post subject: Reply with quote

leopoldus wrote:
But what about copying the full path, including short names of the folders?
As far as I know, TC can not copy short names of files immediately after switching from long names format - and visa versa. In order to get the correct path, you need to go through the whole path from the root folder to your file after you switch to alter name format, otherwise you will get some ugly hybrid of long and short names. Am I right?

Yes, you are right. Forgot about that. Also, a selection of multiple files is lost after cm_SwitchLongNames.

You can use command "cd" and parameter "%p" to go to path with short names.
But it seems you can not use command "cd" and parameter "%P" to go to path with long names.

There seems to be a bug somewhere when you execute the following commands sequentially:
cm_SwitchLongNames
cd %p
cd %P
cm_SwitchLongNames

After this, use the Go back and Go forward buttons to see the history list is messed up.

EDIT:
Bug report: here
EDIT 2:
Doesn't seem to be a bug. See above mentioned thread.


Last edited by white on Sun Sep 08, 2013 10:14 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
HolgerK
Power Member
Power Member


Joined: 26 Jan 2006
Posts: 4801
Location: Europe, Aachen

PostPosted: Sun Sep 08, 2013 2:50 am    Post subject: Reply with quote

Button code (Copy code to clipboard, paste into button-bar, adapt the nircmd-path):
Code:
TOTALCMD#BAR#DATA
C:\Tools\NirSoft\nircmd.exe
clipboard readfile "%l"
WCMICONS.DLL,45
Selected Files to Clipboard (8.3 DOS Names)


-1
http://www.nirsoft.net/utils/nircmd.html

Regards
Holger
Back to top
View user's profile Send private message Send e-mail
leopoldus
Senior Member
Senior Member


Joined: 21 Nov 2004
Posts: 221

PostPosted: Sun Sep 08, 2013 5:56 am    Post subject: Reply with quote

2HolgerK
Thank you, but seems, that something is missed in the code. At least, at my system pressing this button brings to the front Explorer window with Nircmd folder. I've checked the path twice, all is OK. Surrounding nircmd name with quotes does not help too.
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8011
Location: Russian Federation

PostPosted: Sun Sep 08, 2013 6:20 am    Post subject: Reply with quote

leopoldus,
Please check it once again:
Code:
Command: X:\Path\To\nircmd.exe
Parameters: clipboard readfile "%l"

_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
HolgerK
Power Member
Power Member


Joined: 26 Jan 2006
Posts: 4801
Location: Europe, Aachen

PostPosted: Sun Sep 08, 2013 6:21 am    Post subject: Reply with quote

Quote:
I've checked the path twice
Posting the content of the Command field from your button would help to analyze your problem.

Okay, do it manual:
- Drag&Drop nircmd.exe on a free place of the button bar
- Context menu of the new created button -> Change...
- Parameter:
Code:
clipboard readfile "%l"


Regards
Holger
Back to top
View user's profile Send private message Send e-mail
leopoldus
Senior Member
Senior Member


Joined: 21 Nov 2004
Posts: 221

PostPosted: Sun Sep 08, 2013 10:46 am    Post subject: Reply with quote

2HolgerK
Quote:
Posting the content of the Command field from your button would help to analyze your problem.

Here is a copy of my buttons's fields "command" and "parameter"
Code:
"D:\Nirsoft\Nircmd\nircmd.exe"
clipboard readfile "%1"

BTW, I've checked it now at another machine. Here it does not anything at all, even does not open Explorer window.
Back to top
View user's profile Send private message
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 2020
Location: Netherlands

PostPosted: Sun Sep 08, 2013 10:49 am    Post subject: Reply with quote

2leopoldus
You used the number 1 instead of the lowercase L in %l.
Code:
1 does not equal l, although it looks the same in a code block
Back to top
View user's profile Send private message Send e-mail
leopoldus
Senior Member
Senior Member


Joined: 21 Nov 2004
Posts: 221

PostPosted: Sun Sep 08, 2013 10:58 am    Post subject: Reply with quote

white wrote:
You used the number 1 instead of the lowercase L in %l.

Damn it!!! Embarassed Embarassed Embarassed

But how you could detect my mistake so easily? This two symbols looks actually so similar.
Back to top
View user's profile Send private message
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 2020
Location: Netherlands

PostPosted: Sun Sep 08, 2013 11:06 am    Post subject: Reply with quote

leopoldus wrote:
But how you could detect my mistake so easily?

Because it did not work for you. It seemed like the most obvious mistake from the beginning. Probably others expected it too.

What we did not expect that you would not use copy and paste..
Back to top
View user's profile Send private message Send e-mail
leopoldus
Senior Member
Senior Member


Joined: 21 Nov 2004
Posts: 221

PostPosted: Sun Sep 08, 2013 11:29 am    Post subject: Reply with quote

Thanks again!
Well, the only small sub-case still is not solved is copying several selected filenames in 8.3 format without paths.
I've reread now you post above and was not able to understand it in total:
Quote:
You can use command "cd" and parameter "%p" to go to path with short names.
But it seems you can not use command "cd" and parameter "%P" to go to path with long names.

To avoid a new embarrassment I'd better ask just now, what I should do exactly in order to copy filename in 8.3 format by using "cd" command with parameter "%p"?
Back to top
View user's profile Send private message
white
Power Member
Power Member


Joined: 19 Nov 2003
Posts: 2020
Location: Netherlands

PostPosted: Sun Sep 08, 2013 11:46 am    Post subject: Reply with quote

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

As I tried (but failed) to explain above, my solution does not work for several selected files.

leopoldus wrote:

I've reread now you post above and was not able to understand it in total:
Quote:
You can use command "cd" and parameter "%p" to go to path with short names.
But it seems you can not use command "cd" and parameter "%P" to go to path with long names.

To avoid a new embarrassment I'd better ask just now, what I should do exactly in order to copy filename in 8.3 format by using "cd" command with parameter "%p"?

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.

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.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group