Giter VIP home page Giter VIP logo

lnkcreator's Introduction

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.

lnkcreator's People

Contributors

hansalemaos avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.