Welcome to the pylnk project. pylnk is a library for reading and writing Windows shortcut files (.lnk).
Parse a shortcut, access its data and modify it:
:::python
import pylnk
link = pylnk.parse("C:\\path\\to\\shortcut to file.lnk")
print link.path
link.description = "This is a shortcut file"
lnk.save()
More examples and documentation can be found in the documentation section.
Currently, the library can read and write absolute (meaning relative to the computer, their paths start with drive letters) lnks. There are a bunch of other lnks like for network of control panel. They are currently not supported. Feel free to add support for more or ask me about it.
If there is a problem with the library, a feature is missing, or you need help, please file a ticket or drop me an email at dev ät tim-erwin de.
Many thanks to Jordi Sánchez López who helped a great deal with understanding especially the undocumented part of the LNK format.
Also a big thank you to cowimas, the outstanding knowledge and project management solution, for sponsoring some development.