[python-win32] Problem creating a shortcut
mail at timgolden.me.uk
Fri May 16 13:09:46 CEST 2008
Sorry, missed this one going through. Looks like
Roger's hit the nail on the head, though. Bizarre
behaviour by the IShellLink interface: I can't find
any kind of reference to this but I assume that
since the Path attribute of the link should *only*
contain an executable, there's no need for the
quotes -- which then confuse it when they're there
as it tries to make the executable into an absolute
One small comment, Mike. Since you're using the
winshell module -- which I assume is the one from
my site -- why not use its CreateShortcut function?
It's basically just a light wrapper around the IShellLink
functionality which someone else mentioned:
import os, sys
Path=os.path.join (winshell.desktop (), "shortcut.lnk"),
Target=r"c:\Program Files\Mozilla Firefox\firefox.exe",
Description="Open http://localhost with Firefox"
But maybe you're using the WScript.Shell functionality
elsewhere as well?
More information about the python-win32