Page 1 of 1

copy sfn - short file name/path

Posted: 08 May 2007, 13:51
by frax
Hi, I am using a legacy application a lot, that is cross platform etc. Unfortunately it doesn't support long file names and paths fully on windows - at least not ones that have spaces in them.

I would love to be able to copy the sfn version of a long filename, e.g. so that c:\documents and settings is copied as c:\docume~1

...and that wouldn't be that hard to implement, would it... ?

:)

Posted: 08 May 2007, 15:38
by Jan Rysavy
Hi, one workaround: Ctrl+Shift+Space, Ctrl+Shift+Enter, Ctrl+A, Ctrl+C

nice combo ;-)

Posted: 16 May 2007, 18:25
by Klettermaxe
Hi frax,

this might be a solution for your problem:

1) Download and install the powerful freeware autoit3 (http://www.autoitscript.com/autoit3). This will do no harm to your system. The extension .au3 will be associated with autoit afterwards.

If you don't want to install the whole package: The only file you really need is the file autoit3.exe, but you should associate .au3-files with autoit for easier handling.

2) Create a text file with the extension ".au3" in a directory of your choice, e.g. "d:\data files\dospath.au3". The content of this file is only a single line:

Code: Select all

ClipPut ($CmdLine[$CmdLine[0]])

3) In Salamander, create a new user menu entry and name it e. g. "DOSPath". Provide the following details:

Command: d:\data files\dospath.au3
Arguments: $(DOSFullName)
Initial Directory: $(FullPath)

Uncheck "Execute through shell"

Choose an icon of your liking. Make sure that the option "Show item in User Menu Bar" is checked. Of course the user menu toolbar must be visible.

4) Now, when you click on the icon in the user menu bar, the DOS 8+3 path and name of the highlighted file will be copied to the clipboard (without the trailing space you get with Jan's workaround)

Posted: 17 May 2007, 02:09
by th.
This is similar to what Klettermaxe suggested but with the help of a litte freeware tool called winclip.exe (find it at http://www.dmst.aueb.gr/dds/sw/outwit).
Put it somewhere on your computer e.g. d:\tools\winclip.exe and create a user menu item like this:

Command: echo
Arguments: $(DOSFullName)|d:\tools\winclip -c
Initial directory: $(FullPath)

Execute through shell: checked
Open shell window: unchecked

Posted: 18 May 2007, 15:57
by therube
Untested.

Ninotech Path Copy 4.0

Ninotech Path Copy is a shell extension for Windows 95, 98, NT4, 2000, and XP that enables to copy the path of a file or directory to the Clipboard. You can then paste the path in to your document, e-mail, etc. You copy the path of a file or directory by right-clicking it in the Windows Explorer and choosing Copy Path from the context menu. The context menu then offers nine standard ways of copying the path, in addition to the user defined copying methods that you create yourself:


PS: SvA had asked a question here. Maybe he'll repost it.

Posted: 23 May 2007, 14:23
by SvA
My former post got lost with the restore. This is a repost from memory as therube requested.

frax, was your request about copying the path name, in it's 8.3 format to the clipboard, or was it about copying to to the filesystem?

Concerning copying directory trees, preserving both long and short filename, I have been looking for a solution for a long time, but have not yet found one. This however, was an important feature for backup and system migration, in order to not break aplications that store short file/path names in their configuration or use short filenames to link documents/resources.

Even most (if not all) backup programs are unable to restore the original short filename. The only solution to the problem, known to me, are disk imaging programs.

So, if Altap could find and implement a solution to this, this was a feature which would set appart Altap Salamander from all the rest of the bunch of file managers.

There are solutions to copy a tree of files and directories just using the original short filename, stripping the long filename. I'd use Microsoft's Robocopy for the task. You can use one of the GUIs for it if you don't like command line programs (especially one with such a welth of commands and options).

Posted: 24 May 2007, 21:46
by therube