My shortcut target implementation could not use the win32com module and after a lot of searching, decided to come up with my own.
I know this is an older thread but I feel that there isn't much information on the method that uses the link specification as noted in the original question. lnk file can be created from scratch be creating a LNK object, populating it with data and then saving it to a file. lnk file yields a LNK object which can be altered and saved again. lnk files and extract all relevant information from them. lnk files and Python library for reading and writing Windows shortcut files (.lnk). Python library for reading and writing Windows shortcut files (.lnk). You can search for 'python ishelllink' for other examples.Īlso, the API reference helps too: (VS.85).aspx Shortcut.SetWorkingDirectory (mydocs_path) Mydocs_path = shell.SHGetFolderPath (0, shellcon.CSIDL_PERSONAL, 0, 0) Shortcut.SetDescription ('Updated Python %s' % sys.version) Persist_file = shortcut.QueryInterface (pythoncom.IID_IPersistFile) Shortcut_path = os.path.join (desktop_path, 'python.lnk') Here is a good example found after Googling: import os, sysįrom win32com.shell import shell, shellconĭesktop_path = shell.SHGetFolderPath (0, shellcon.CSIDL_DESKTOP, 0, 0)