win32api -- long vs short filenames

David Ascher da at
Wed Aug 4 14:52:20 EDT 1999

On Wed, 4 Aug 1999, David Niergarth wrote:

> I'm trying to expand a mangled DOS 8+3 name (from WinNT4.0) into the long
> version of the name. There's a win32api function for doing the opposite, for
> example,
> >>> win32api.GetShortPathName(r'c:\long_path_name\long_file_name.txt')
> 'c:\\LONG_P~1\\LONG_F~1.TXT'
> But I can't figure out how to expand a mangled name into the original long
> name. Any ideas?

>>> win32api.FindFiles(r'c:\PROGRA~1')[0][-2]
'Program Files'

See doc in the .hlp file.


More information about the Python-list mailing list