Page 1 of 1

[SOLVED] Create_shortcut() function with a URL

Published: July 23, 2024 - 3:39 PM
by t.heroult
Good morning
I'm trying to create shortcuts to web addresses using the create_shortcut() function, but it returns an error. Does the function only work with local targets?

Here is the message:

Code: Select all

2024-07-23 15:32:26,424 CRITICAL Fatal error in install script: 0x80070057 : Paramètre incorrect.:
Traceback (most recent call last):
  File "C:\Program Files (x86)\wapt\common.py", line 4235, in install_wapt
    exitstatus = setup.install()
  File "c:\waptdev\La_Normandise_2024.7.16-1_x64_PROD_fr-wapt\setup.py", line 73, in install
    create_shortcut(icopath,target=icotarget)
  File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 3983, in create_shortcut
    winshell.CreateShortcut(path, target, arguments, wDir, (icon, 0), '')
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 887, in CreateShortcut
    lnk = shortcut (Target)
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 507, in shortcut
    return Shortcut.from_target (source)
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 414, in from_target
    return cls (
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 391, in __init__
    setattr (self, k, v)
  File "C:\Program Files (x86)\wapt\lib\site-packages\winshell.py", line 456, in _set_path
    self._shell_link.SetPath (path)
pywintypes.com_error: (-2147024809, 'Paramètre incorrect.', None, None)

FATAL ERROR : 0x80070057 : Paramètre incorrect.
Exit code:  3
How can I generate a shortcut to a web address?

Sincerely
Tom

Re: create_shortcut() function with a URL

Published: July 23, 2024 - 5:43 PM
by dcardon
Hello Thomas,

Code: Select all

create_shortcut('mon_lien.url','https://wapt.tranquil.it')
Make sure to include a .url at the end of the link name :-)

Sincerely,

Denis

Re: create_shortcut() function with a URL

Published: July 24, 2024 - 1:20 PM
by t.heroult
Great, thanks Denis!