views:

105

answers:

1

I noticed that if you get a Scripting.File object from certain windows files (Example: any wav in C:\Windows\Media) the Scripting.File.ShortPath property shows the long path. Curious I dropped to the command prompt and tried Dir /A /X and sure enough the short paths were missing from all the files in that directory.

Anyone know:
A.) What that's all about?
B.) How to get the short path of a file that doesn't seem to have one?

+6  A: 

A) NTFS doesn't have to contain short paths (in fact there is a registry key to disable it at all times). Looks like for some reason there is no short file names created for those media files.

B) You can't, the short path on an NTFS file system is stored as a distinct NTFS attribute, normally if a filename can meet 8.3 it stores only one, if it doesn't meet that criteria then it can store both a long and a short file name. If the short one isn't stored then there is no way to reference that file by any short name.

C) Why do you need the short file name at all?

tyranid
C:) Having trouble with an old Win32 API call and wanted to see if giving it a shortname made a difference:)
Aaron Bush
Fair nuff, was just wondering :)
tyranid