DOS file name vs. Windows filename

  • Thread starter Thread starter Boris
  • Start date Start date
B

Boris

I need to find the dos file name for the file including
the path, I can find Windows filename.

For example:
C:\Program Files\GlobalSCAPE\CuteZIP\ is c:\progra~1
\global~1\CuteZIP\

Cause some programs require

Thank you in advance
Boris
 
I need to find the dos file name for the file including
the path, I can find Windows filename.

For example:
C:\Program Files\GlobalSCAPE\CuteZIP\ is c:\progra~1
\global~1\CuteZIP\

Cause some programs require

Thank you in advance
Boris

Well, since MS-DOS doesn't exist in XP, you won't find the "DOS" name.

What are you looking for? The long file name path, or the 8.3
filename path? For the first, try start/run/cmd. For the latter, use
start/run/command.
 
"Boris" said in news:[email protected]:
I need to find the dos file name for the file including
the path, I can find Windows filename.

For example:
C:\Program Files\GlobalSCAPE\CuteZIP\ is c:\progra~1
\global~1\CuteZIP\

Cause some programs require

Thank you in advance
Boris

"dir /x" DOS command works. Run "dir /?" to see all the options available
for the dir command. Unfortunately, you'll have to start in the folder
containing the file to get its short filename (SFN), then walk back through
the directories getting each one's SFN until you hit the root folder so
you'll know the SFN of every directory in the path to the file. Sucks.

It could be your program doesn't know how to handle filenames with embedded
spaces (most programs won't parse correctly because they parse on spaces).
You need to encapsulate the path and filename within double quotes, like in:

dir "C:\Program Files\GlobalSCAPE\CuteZIP\"

and not as:

dir C:\Program Files\GlobalSCAPE\CuteZIP\

because the last one will try to list the [probably non-existent]
C:\Programs directory.
 
Boris said:
I need to find the dos file name for the file including
the path, I can find Windows filename.

For example:
C:\Program Files\GlobalSCAPE\CuteZIP\ is c:\progra~1
\global~1\CuteZIP\

That illustrates the method: If a name is longer than the 8 characters
of the 8.3 DOS format, then it is truncated to six DOS compatible ones
(ie spaces removed), in Upper case and then ~n added, starting with ~1.
So if you were now to make another folder
C:\Programs I have deleted\
that would be C:\PROGRA~2\
 
Well, since MS-DOS doesn't exist in XP, you won't find the "DOS" name.

Don't get side-tracked into a futile "it's DOS, no it isn't, yes it
is" debate here. As long as files can be (and sometimes are)
referenced via 8.3 name, we will need visibility of that name.
What are you looking for? The long file name path, or the 8.3
filename path? For the first, try start/run/cmd. For the latter, use
start/run/command.

Yes, it's interesting how NT's Command.com lacks the ability to show
LFNs, which Win9x's Command.com does when run from the GUI.

There are two reasons why we *need* to see 8.3 names:
- malware risk assessment
- troubleshooting LFN issues

See http://users.iafrica.com/c/cq/cquirke/lfns.htm on the latter.
Extra detail particular to NT (XP = NT 5.1) follows...

When LFNs are created, an 8.3 name is generated as either NAMEBASE.EXT
or more usually NAMEBA~1.EXT (there's a NumericTails flag that
determines which; generally, safer to leave tails enabled).
Subsequent LFNs may generate the same 8.3 name, so an incrimenting
index is used; NAMEBA~2.EXT, NAMEBA~3.EXT etc.

So far, so much the same for Win9x and NT. But after the first few
incriments, NT veers off and uses a different strategy - one that is
better for large numbers of NAMEB~99.EXT etc. That can have
implications if both Win9x and NT have to play in the same space.


In Win9x up to but excluding WinME, you could rt-click, Properties and
see the 8.3 ("DOS name") that way. Since that facility was
prematurely discarded, it's more difficult; I'd suggest a Dir from a
command prompt window, as that should show both.

The reason I say "prematurely", is that 8.3 names are still used
directly, sometimes even within the OS itself (e.g. Win9x's processing
of .inf files; dunno if XP still has the same problems there). For
that reason, as well as the malware thing, we still need the info.


--------------- ----- ---- --- -- - - -
Dreams are stack dumps of the soul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top