Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, winshell
- from win32com.client import Dispatch
- desktop = winshell.desktop()
- path = os.path.join(desktop, "Mozilla Firefox.lnk")
- target = r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'
- wDir = r'C:\Program Files (x86)\Mozilla Firefox'
- icon = r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe'
- description = "I am a teapot"
- shell = Dispatch('WScript.Shell')
- shortcut = shell.CreateShortCut(path)
- shortcut.Targetpath = target
- shortcut.WorkingDirectory = wDir
- shortcut.IconLocation = icon
- shortcut.Description = description
- shortcut.save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement