1
Vote

win2k8/vista "short" path returned

description

When running on win2k8 or vista the OpenFileDialog style folder browser is displayed but the path that is returned is the "mangled" short DOS path.

e.g.
c:\temp\longfoldername\longsubfolder1\longsubfolder2
is returned as
c:\temp\longfo~1\longsu~1\longsu~2

I'm letting the user select a folder and I'm creating a sub-folder in my app, so I want to check that the selected folder path is < 230 characters long, when I test a long path the length is being returned as 60 characters because it's using the mangled DOS folder names; when I then pass it to Directory.Exists or others, they throw an PathTooLongException.

comments