Problem creating a shorcut
Tim Golden
mail at timgolden.me.uk
Fri May 16 07:09:51 EDT 2008
Wolfgang Draxinger wrote:
> 1) you should not hardcode the backslashes ('\'), instead use
> os.sep for it.
With respect, the OP is creating a Windows desktop shortcut.
Unless Microsoft suddenly decide to change their use of the
backslash, I suggest that this is a needless generalisation.
> 3) You assume, that Firefox is always installed at C:\Program
> Files\Mozilla Firefox\firefox.exe
> However the path largely differs from system to system.
This is broadly true. However, it's fairly clear from the
phrase "the user's desktop" that the OP is working in some
kind of corporate environment where he can be fairly sure
where Firefox is installed by policy. In addition, it's not so
easy to find its path if it's not in the default place since apps
very rarely add their location to the system PATH these days
(and Firefox certainly doesn't). You could scan the registry for
its App Paths entry in the registry but I don't know if any other
way if it's not the default browser (which it's clear from the
original post it may not be).
Sorry to sound a bit negative, but I felt that a couple of your points,
while valid, were not altogether helpful to the situation the OP was in.
TJG
More information about the Python-list
mailing list