Skip to main content

Windows LNK File Parser and Creator

Project description

WinLnks



Python library for reading and writing Windows shortcut files (.lnk).

This library can parse .lnk files and extract all relevant information from them. Parsing a .lnk file yields a LNK object which can be altered and saved again. Moreover, .lnk file can be created from scratch be creating a LNK object, populating it with data and then saving it to a file. As that process requires some knowledge about the internals of .lnk files, some convenience functions are provided.

CLI

Mainly tool has two basic commands.

Parse existed lnk file

winlnks parse [-h] filename [props [props ...]]

positional arguments:
  filename    lnk filename to read
  props       props path to read
 
optional arguments:
  -h, --help  show this help message and exit

Create new lnk file

usage: winlnks create [-h] [--target [TARGET]][--arguments [ARGUMENTS]] [--description [DESCRIPTION]] [--icon [ICON]]
                     [--icon-index [ICON_INDEX]] [--workdir [WORKDIR]] [--mode [{Maximized,Normal,Minimized}]]

optional arguments:
  -h, --help            show this help message and exit
  --target [TARGET], -t [TARGET]
			Target path
  --output [OUTPUT], -o [OUTPUT]
                        .lnk file path
  --arguments [ARGUMENTS], -a [ARGUMENTS]
                        additional arguments
  --description [DESCRIPTION], -d [DESCRIPTION]
                        description
  --icon [ICON], -i [ICON]
                        icon filename
  --icon-index [ICON_INDEX], -ii [ICON_INDEX]
                        icon index
  --workdir [WORKDIR], -w [WORKDIR]
                        working directory
  --mode [{Maximized,Normal,Minimized}], -m [{Maximized,Normal,Minimized}]
                        window mode

Examples

py winlnks.py parse C:\Temp\calc.lnk
py winlnks.py create -t C:\windows\system32\calc.exe -o C:\Temp\calc.lnk              
winlnks create -h
winlnks p C:\Temp\calc.lnk
winlnks c --target C:\windows\system32\calc.exe --output C:\Temp\calc.lnk --mode Minimized --description "calc shortcut"          

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

winlnks-0.2.2.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

winlnks-0.2.2-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file winlnks-0.2.2.tar.gz.

File metadata

  • Download URL: winlnks-0.2.2.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for winlnks-0.2.2.tar.gz
Algorithm Hash digest
SHA256 045f2b854bccc352311d562d09ef4a1f858ebb2992f293549e8ca1528eef8090
MD5 5d37b58e0f7127334c2bd006eab4ad19
BLAKE2b-256 7cfa9fe5b21a97594a83079dba9c4c79bf9955113513d77b15620099ee891119

See more details on using hashes here.

File details

Details for the file winlnks-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: winlnks-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for winlnks-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d15ac0dc990f8c3a362f536fc260351b27226aa5f5f1d03ede4484b893b42269
MD5 dd43e5c503ddfc99029e5f521389ab91
BLAKE2b-256 23c86e84e8a2a1c0fe7eda6cf37096cabb5ecb81f967d2697d2f0d5ceb20a867

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page