[python-win32] Problem creating a shortcut

Mark Hammond mhammond at skippinet.com.au
Fri May 16 01:45:54 CEST 2008


Tim wrote:

> Plus, the "Program Files" path name is localized on
> the international versions of Windows.

Obviously Tim is correct that you can't assume FF is in Program Files, but
if you really did want the Program Files dir for other reasons, the way to
get it is:

>>> from win32com.shell import shell, shellcon
>>> shell.SHGetSpecialFolderPath(0, shellcon.CSIDL_PROGRAM_FILES)
u'C:\\Program Files'
>>>

Also, IIRC, shortcuts can include environment strings, so specifying
"%ProgramFiles%" in the target might also work (but again, only if you are
sure you really want Program Files :)

Mark



More information about the python-win32 mailing list