Page 1 of 1

Creating a desktop shortcut

Published: February 22, 2017 - 3:16 PM
by swagvinvin
Hello,
First, I'd like to mention that I've looked at this link:
https://dev.tranquil.it/sphinxdocs/sour ... p_shortcut

Here's how I'm trying to create my shortcut in the setup.py file:

def session_setup():
create_user_desktop_shortcut(ShortcutName,target='targetFile','my.exe')

There must be something I'm missing.

Could someone describe the command in plain English?
Thank you

Re: Creating a desktop shortcut

Published: February 27, 2017 - 8:59 AM
by gaelds
I create my shortcuts in a folder on the public desktop using the "create_shortcut" function, an example of which is shown below:

Code: Select all

create_shortcut(makepath(common_desktop(),'Logiciels','SketchUp 2014.lnk'),target=r'%s\SketchUp\SketchUp 2014\SketchUp.exe' %programfiles, wDir=r'%s\SketchUp\SketchUp 2014\\' %programfiles,icon=r'%s\SketchUp\SketchUp 2014\SketchUp.exe' %programfiles)
 
Worth testing, but I think you can use:

Code: Select all

create_user_desktop_shortcut("Nom du raccourci",target=r'C:\dossier\mon.exe',wDir=r'C:\dossier\\',icon=r'C:\dossier\mon.exe')
The wDir and icon options allow you to specify the startup folder and the path to the icon.