On Sun, 08 Apr 2007 11:50:17 +0100, Terry Pinnell
>Although probably not directly on-topic, I'm hoping the experts here
>can help please. How I can automatically convert a long filename like
>C:\Program Files\This example.exe to a DOS 8.3 name like
>C:\Progra~1\Thisex~1.exe ?
Dir /X will show the actual short names, whereas what you see with the
%~s1 logic may be spurious (as that works even if the file or path
doesn't exist).
Let's test that... hmm, seems as if the logic is:
- if exists, show the 8.3 name
- if does not exist, show the given name
That's better than generating faux short names, and is OK if you
combine it with If Exist logic, or other "existance" tests.
>I'm sure I've seen some clever way to do it from an XP Explorer or My
>Computer folder, but I'm darned if I can find it.
In Win95/98, Properties would show you the real 8.3 name of a file,
but this was stripped out in WinME. Silly, as there are times when
you DO have to pay attention to the man behind the curtain.
>I recall something like dragging the file into a Command Prompt
>window, but when I try that it merely displays the original long name.
Command.com is LFN-aware, but the behavior can change if it dips into
a LFN-unaware context. You can test this yourself; start a Cmd or
Command prompt in (say) "C:\Program Files" and do a few things; at
some point, the command prompt will switch to C:\PROGRA~1 and once it
does, it generally won't switch back for the rest of that session.
>The reason I want to do this is to place 'shortcuts' in text files. My
>text editor, TextPad, lets me r-click strings like the following to go
>directly to the targets:
>
>http://www.example.com to go to a website
>
>file://D:/Docs/Example.txt to open that file on my HD
>
>file://D:/Docs/Thisex~1.txt to open the file 'D:\Docs\This
>Example.txt' on my HD
>
>So, taking that last example, I want to be able to select the file
>D:\Docs\This Example.txt in say an XP folder, and get
>D:\Docs\Thisex~1.txt onto the clipboard, without having to do it
>manually. Rather like the indispensable MS Powertoys TweakUI facility
>'Send to > Clipboard as a name'.
Does it help to "use quotes for names with spaces"?
>-------------------- ----- ---- --- -- - - - -
Tip Of The Day:
To disable the 'Tip of the Day' feature...
>-------------------- ----- ---- --- -- - - - -