Page 1 of 1

[RESOLVED] Command at login

Published: September 27, 2022 - 5:18 PM
by smandel
Good morning,

I am looking for a solution to launch a web page every time a session is opened.
I tried via session-setup but it only runs once.
Do you have a pure Wapt solution?

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *

def install():
    pass

def session_setup():
    run("start https://www.google.fr")
THANKS !

Re: Command at login

Published: September 29, 2022 - 2:47 PM
by smandel
Good morning,

I'm answering myself...
So I managed to figure it out with this code:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
from setuphelpers_windows import *
uninstallkey = []


def install():
    print('Install shortcut')
    create_programs_menu_shortcut('Site.url',target='https://notresite.fr',folder='Startup')

def uninstall():
    print('Remove shortcut')
    remove_programs_menu_shortcut('Site.url','Startup')

def audit():
    if isfile(makepath(winshell.programs(common=1), 'Startup', 'Site.url')):
        print("Shortcut exist")
        return "OK"
    else:
        print("Shortcut not exist")
        return "WARNING"
Hopefully this can help other people...

Re: Command at login

Published: October 3, 2022 - 12:03 PM
by dcardon
Thanks Smandel for sharing! :-)

Denis