Short
Pathnames |
Previous Top Next |
· | Short
pathnames eliminate spaces |
Short
pathnames eliminate spaces from paths which prevents some
compatibility and security issues. For example, when executing the
command "C:\Program Files\Microsoft Office\OFFICE11\winword.exe
c:\Myfile.doc" using ShellExecute, Windows will actually try a
number of possible commands to see if they are valid:
|
c:\Program.exe
"Files\Microsoft Office\OFFICE11\winword.exe c:\Myfile.doc"
|
c:\Program
Files\Microsoft.exe "Office\OFFICE11\winword.exe c:\Myfile.doc"
|
c:\Program
Files\Microsoft.exe Office\OFFICE11\winword.exe "c:\Myfile.doc"
|
|
If a
user creates the file c:\Program.exe on a PC, it could break office
and also represents a security threat. |
|
· | Short
pathnames allow compatibility with legacy applications
|
16 bit
applications cannot support filename paths other than 8.3 style.
When windows runs 16bit applications, it will provide applications
with the short pathname version for all filenames. This typically
does not come into play for most people, but was one of the primary
reasons for the original conception of short pathnames.
|
|
· | Short
pathnames work-around Windows API path length limitations
|
Many
Windows API functions have limitations on the maximum string length
they can handle for paths. For example on Windows XP SP1, the
ShellExecute API command cannot handle a string length longer than
128 characters. Often the registry is used to store a value that
look like "Command + Parameters" like this entry for Office 2003:
|
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\ois.exe\shell\Edit\command
|
DefaultValue
= C:\PROGRA~1\MICROS~3\OFFICE11\OIS.EXE /shellEdit "%1"
|
|
If the
Exe filename plus the parameter is greater than 128 characters, the
command will fail on XP SP1 (Microsoft extended the length for
ShellExecute in SP2). Considering the user is likely to use a
filename from their "My Documents" folder, and the filename may be
significantly long - if you don't use short pathnames there is a
very high chance of failure. |
|
For
example, this command exceeds 128 characters (168 chars):
|
C:\Program
Files\Microsoft Office\OFFICE11\winword.exe c:\documents and
settings\Greogory Appleblaught\My Documents\Draft 34 April 6 2006
Master License Agreement.doc |
|
The
same path is much smaller using short pathnames (85 characters):
|
C:\Progra~1\Micros~3\OFFICE11\winword.exe
c:\docume~1\Greogo~1\MyDocu~1\Draft3~1.doc |
|
|
|
Out
of process COM |
HKEY_CLASSES_ROOT\CLSID\{00020800-0000-0000-C000-000000000046}\LocalServer32
|
C:\PROGRA~1\MICROS~3\OFFICE11\GRAPH.EXE
/automation |
|
In
process COM |
HKEY_CLASSES_ROOT\CLSID\{0002E55E-0000-0000-C000-000000000046}
|
C:\PROGRA~1\COMMON~1\MICROS~1\WEBCOM~1\11\OWC11.DLL
|
|
Crytography
|
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider\Microsoft
Exchange Cryptographic Provider v1.0 |
C:\PROGRA~1\MICROS~3\OFFICE11\EXCHCSP.DLL
|
|
Intelligent
Search |
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Intelligent
Search\Schema\1.0\XML\MSUSP |
File1
= C:\PROGRA~1\MICROS~3\OFFICE11\USPTYPES.XML |
|
Interenet
Explorer plugins |
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet
Explorer\Extensions\{92780B25-18CC-41C8-B9BE-3C9C571A8263}
|
Icon
= C:\PROGRA~1\MICROS~3\OFFICE11\REFBAR.ICO |
|
Location
of shared DLLs |
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Common\FilesPaths
|
mso.dll
= C:\PROGRA~1\COMMON~1\MICROS~1\OFFICE11\MSO.DLL |
|
Error
reporting and crash handling
|
HKEY_LOCAL_MACHINE\Software\Microsoft\PCHealth\ErrorReporting\DW\Installed
|
DW0200
= C:\PROGRA~1\COMMON~1\MICROS~1\DW\DW20.EXE |
· | In-process
and out-of-process COM failure. |
The
application tries to create COM objects and fails because the
registry values point to the in-process or out-of-process COM
server no longer point to the correct location. |
· | MSI is
executed to reinstall the application even though it was fully
installed. |
msi.dll
performs an integrity check for all msi installed components
requested by the application. If msi.dll notices a DLL or data file
is not located at the same location as it was originally installed
to, it will kick off a reinstall procedure to try to correct the
problem. |
|
· | Failure
to execute child processes |
Many
child process applications are executed using registry values that
point to short pathnames. If the values do not point to the correct
location, the child process will fail to launch. This will often
render the application unusable. |
· | Application
fails to load |
Applications
may crash or fail to load because the cannot locate there
installation path or shared DLL paths using registry data.
|
· | Application
complains of missing data files |
The
application may display error messages relating to missing files
because it can no longer locate a file using a short pathname
pointer from the registry. |