Microsoft KB Archive/142275

{|
 * width="100%"|

Long File & Path Names Shorten When Launched Using Association

 * }

Q142275

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), used with:
 * Microsoft Windows NT Server version 3.51
 * Microsoft Windows NT Workstation version 3.51
 * Microsoft Windows 4.0
 * Microsoft Windows 95

-

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 =  "%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

Issue type :

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch