Creates .lnk files on Windows (with Admin rights if desired)
Project description
Creates .lnk files on Windows (with Admin rights if desired)
pip install lnkcreator
from lnkcreator import create_shortcut
create_shortcut(
shortcut_path=r"C:\Users\hansc\Downloads\PJeOffice.lnk",
target=r"C:\Users\hansc\Downloads\PJeOffice.exe",
arguments=(),
minimized_maximized_normal='normal', #
asadmin=True, # enables the admin check box
hotkey='ctrl+x',
working_dir=None, # dir of target will be used
)
Creates a Windows shortcut (.lnk) file at the specified path with the specified properties.
Args:
shortcut_path (str): The path where the shortcut file will be created.
target (str): The path of the target file or application that the shortcut will point to.
arguments (list): A list of arguments to be passed to the target file or application.
hotkey (str, optional): The hotkey combination to activate the shortcut. Defaults to "".
working_dir (Union[str, None], optional): The working directory for the target file or application. Defaults to None.
minimized_maximized_normal (str, optional): The window state of the target application when the shortcut is activated.
Possible values are "minimized", "maximized", or "normal". Defaults to "minimized".
asadmin (bool, optional): If True, the shortcut will be created with administrative privileges. Defaults to False.
Returns:
str: The JavaScript content used to create the shortcut.
Raises:
OSError: If the shortcut file cannot be created.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lnkcreator-0.10.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lnkcreator-0.10.tar.gz.
File metadata
- Download URL: lnkcreator-0.10.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03c85e9ec5f1e5959fdd4fe98d1377c44b6ea3d4a0e95bbdb1304cd3f6f203e9
|
|
| MD5 |
e75192bd9346f27324d041d8ae13e855
|
|
| BLAKE2b-256 |
8d7201dc482e9c0177be84e752d6a62ed98b2396fe87c24e1cb0e550fa0c3bb4
|
File details
Details for the file lnkcreator-0.10-py3-none-any.whl.
File metadata
- Download URL: lnkcreator-0.10-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45721e7ad304180a0f38cd3ef49a395bf3ef7a0ea39abaa051024665f84b7182
|
|
| MD5 |
18fe7175dcfc4f552b3d9093ef34ddb0
|
|
| BLAKE2b-256 |
25bc219edc1f25eca886196e02dc1db7b4b92cd955a168ef52749ada50b3c2f0
|