Python utility convert Windows long file name into 8.3 DOS format

vincent wehren vincent at
Thu Oct 28 10:55:16 CEST 2004

Simon Brunning wrote:
> On Thu, 28 Oct 2004 06:47:28 GMT, Ben Kial <benkial at> wrote:
>>Is there a Python program to convert Windows long filename, like "c:\Program
>>Files" into the old DOS 8.3 format, like "c:\Progra~1"?
>>>>import win32api
> 'D:/share/FROM_R~1/simon/python/RANDOM~1/RANDOM~1.PYW'

Just note that GetShortPathName expects a valid and accessible path in 
your file system.

Vincent Wehren

More information about the Python-list mailing list