Win32api.... can it create a Windows shortcut (.lnk) file?
Gaetan_Corneau at baan.com
Thu Nov 11 15:17:04 CET 1999
There is a VB example:
'NOTE: In Visual Basic 5.0, change Stkit432.dll in the following
'statement to Vb5stkit.dll.
Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal _
lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal _
lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
Dim lReturn As Long
'Add to Desktop
lReturn = fCreateShellLink("..\..\Desktop", _
"Shortcut to Calculator", "c:\Winnt\system32\calc.exe", "")
'Add to Program Menu Group
lReturn = fCreateShellLink("", "Shortcut to Calculator", _
'Add to Startup Group
'Note that on Windows NT, the shortcut will not actually appear
'in the Startup group until your next reboot.
lReturn = fCreateShellLink("\Startup", "Shortcut to Calculator", _
If you have NT 4, you should have Vb5stkit.dll already (I do, and I don't
I think a better way with Python would be using the IShellLink COM
interface, but I have never used it.
Hope this helps,
Software Developer (Quality Assurance Team)
BaaN Supply Chain Solutions
E-mail: Gaetan_Corneau at baan.com
Compuserve: Gaetan_Corneau at compuserve.com
ICQ Number: 7395494
Tel: (418) 266-8252
"Profanity is the one language all programmers know best"
> -----Original Message-----
> From: me [mailto:none at fake.net]
> Sent: Thursday, November 11, 1999 1:54 AM
> To: python-list at python.org
> Subject: Win32api.... can it create a Windows shortcut (.lnk) file?
> I'm just trying to find an easy to create shortcuts on
> Windows platforms
> through Python... it doesn't seem to be a simple matter
> though. I've gone
> through all the Win32 docs, and found nothing, and have
> started writing
> (with limited success) a C function to do it.
> Is there an easy way? q:]
> Kevin Cazabon
> kcazabon at home.com
More information about the Python-list