[Tutor] Creating windows shortcuts with win32com.shell

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Thu, 4 Oct 2001 14:57:57 -0700 (PDT)


On Wed, 3 Oct 2001, Reed, David wrote:

> I'm a looking for a module and method that will allow me to make
> Windows 2000 shortcut files or (lnk).  Do you have documentation or
> reference as to how to do this?

You might want to ask your question on the comp.lang.python newsgroup too
--- this might be too specialized a question, and I'm not sure if many of
us here are familiar with Win2k-specific stuff.


There's a web site that has reference documentation for Windows stuff:

http://aspn.activestate.com/ASPN/Reference/Products/ActivePython/PythonWin32Extensions/PythonWin32Extensions.html

but it looks really dense... searching... ah!


It looks like you'll want the IShellLink interface.  The win32all "Windows
Extensions" page mentions that you can make shortcuts with it:

"""IShellLink interface now supported in the "win32com.shell" extension,
which allows Python to create and/or resolve Windows "shortcut" files."""

http://starship.python.net/crew/mhammond/win32/RecentChangeHistory.html


Take a look at:

http://aspn.activestate.com//ASPN/Reference/Products/ActivePython/win32com/win32com.shell_and_Windows_Shell_Links.html

and

http://aspn.activestate.com//ASPN/Reference/Products/ActivePython/win32com/PyIShellLink.html

which talks about PyIShellLink objects: they appear to be what you're
looking for.