Long File & Path Names Shorten When Launched Using Association

ID: Q142275


The information in this article applies to:


SYMPTOMS

When an application is installed along a path that contains a space (as in C:\Program Files\MyApp) and you double-click a data file registered to MyApp.exe in Explorer (or any other shell), you will only get a short file name on the command line.


RESOLUTION

To resolve the problem, place quotation marks around the around the arguments list in the registry entries, as in this example:


 HKEY_CLASSES_ROOT\MyApp\Shell\Open\Command =
   <path to MyApp.exe> "%1" 


Without the quotation marks, short names are the result. With quotation marks, long file names are the result. This works correctly in Windows 95 and Windows NT 3.51.


STATUS

This behavior is by design.


MORE INFORMATION

The 8.3 file name specification didn't allow spaces in filenames, so the system automatically converts long file names to short filenames when no quotation marks are used to differenciate between a long file name and a list of short names seperated by spaces.

Basically the shell looks at the .exe type of the program refered to, if it is a win32 .exe, the shell passes a long name by default (as %1), if it is not, the shell passes the short name. The code that sniffs the .exe type requires the quotation marks to get this right.

Additional query words: 4.00


Keywords          : kbenv 
Version           : 4.00 | 3.51
Platform          : NT WINDOWS 
Issue type        : 

Last Reviewed: March 5, 1999