[RESOLVED] Shortcut error
Published: September 25, 2020 - 2:52 AM
Good morning,
Every time I try to use the remove_desktop_shortcut and remove_user_desktop_shortcut functions, I get errors when running them on clients, but not when I package them in PyScripter.
So I did this:
It's just to share...
Every time I try to use the remove_desktop_shortcut and remove_user_desktop_shortcut functions, I get errors when running them on clients, but not when I package them in PyScripter.
So I did this:
Code: Select all
profils = get_local_profiles()
list_check = ['Prog1.lnk','Prog2.lnk','prog 1.lnk','prog_1.lnk']
for chemin in profils:
for lnk in list_check:
chemin_user = makepath(chemin['profile_path'],'Desktop',lnk)
if isfile(chemin_user):
print(chemin_user)
remove_file(chemin_user)
for lnk in list_check:
chemin_public = makepath(systemdrive,'Users','Public','Desktop',lnk)
if isfile(chemin_public):
print(chemin_public)
remove_file(chemin_public)