PDA

View Full Version : Short file names - how do you create them in SF


mmgroup
10-16-2001, 12:00 AM
I need to write a file path (gathered from a startup variable) into an INI file in the old 8.3 format.

ie

c:\program files\the language market\japanese\

needs to look like

c:\progra~1\thelan~1\japane~1\

I've noticed else where from searches that you need to put quotes around a long file name if it contains spaces - but nothing on truncating to DOS/Win3.1 friendly format.

Cheers
Alistair

Mark
10-19-2001, 11:51 AM
Hi,

Sorry but there is no way to convert long file names into short using Setup Factory.

Which path do you want to write into the INI file?

mark.

mmgroup
10-19-2001, 11:44 PM
Originally posted by Mark:
Hi,

Sorry but there is no way to convert long file names into short using Setup Factory.

Which path do you want to write into the INI file?

mark.

I want to write the install path into the ini file of a 3rd party double byte font interpreter we are using. The DBFI is written in 16bit code and will only recognise short file names.

Given that SF won't truncate then I guess I'm forced to install the app in the root of C drive (or something similar).

Alistair

dom
10-25-2001, 10:13 AM
I had the same problem. I solved it by using the relative path (".\") instead of the absolute path in the INI file.

Brett
10-26-2001, 09:17 AM
Although it would be a bit of work, there is a Windows API (Shell) call "GetShortPathName". You could write a small C++ program that accepts a long filename as an argument and then writes the short name out to the INI file. Othrwise, hold out for SUF60 (next week) which has a built-in function to make a long filename into a short filename.

- Brett

Lorne
10-26-2001, 09:47 AM
You could actually do this using a batch file, using stub files and the DIR command with the /X option.

Have a look at the Short2Long.bat file in the following batch file archive:
http://www.ss64.demon.co.uk/ntsyntax/ss64_NT.zip

The batch file is NT-specific, so if you only need this to work on NT you could use that file as-is. Otherwise, you'll need to add logic to the batch file to detect the OS and use the different command options available in 9x.

mmgroup
10-28-2001, 03:36 PM
Originally posted by dom:
I had the same problem. I solved it by using the relative path (".\") instead of the absolute path in the INI file.

Relative paths are no good for our project unfortunately.

Alistair