Forum Moderators: phranque

Message Too Old, No Replies

Converting filenames to dos (8.3) format

Converting Windows long filenames to DOS filename format 8.3

         

stevet

4:20 pm on Jul 17, 2002 (gmt 0)

10+ Year Member



Is there any utility, program or software available that can convert Windows Long filenames to the DOS filename format of 8.3?

i.e. If I have filenames in the form of:
thisfileisnotinthecorrectformat.xxx
thisnameistoolong.xxxx etc

I would like to convert them to something like

thisfile.xxx
thisname.xxx
or
thisfil1.xxx
thisfil2.xxx
etc

I have about 200 files to convert.

Would appreciate any advice.

Steve

gsx

6:40 pm on Jul 17, 2002 (gmt 0)

10+ Year Member



Windows does store them in DOS (8.3) format, it never really has had long filenames - just an interface that makes you think it does. Enter DOS and type 'Dir' and the left hand side you will see the DOS names. You can access the files by the DOS name as well as the Windows name. They usually have the '~' character in them.

Doofus

10:15 pm on Jul 17, 2002 (gmt 0)



The Windows API function that converts from the long format to the 8.3 short format is called GetShortPathName()

Do a Google search for +getshortpathname +utility and you may find something.

By the way, 255 characters are allocated for long filenames. These are actually stored by Windows. When you convert from long to short, you lose information.

To avoid duplicates, the ~1, ~2, ~3 system is used. Once you convert from long to short, you can't go back unless you do it manually (if you've done a "hard convert").

But if you do a convert within the context of a single Windows installation, and are just accessing the short names for convenience without a hard rename, then you're merely accessing a long filename by its short handle, and nothing has been converted.