Ejemplo n.º 1
0
def create_shortcut(path, target):
    from comtypes.client import CreateObject
    shell = CreateObject("WScript.Shell")
    from comtypes.gen import IWshRuntimeLibrary

    shortcut = shell.CreateShortcut(path).QueryInterface(
        IWshRuntimeLibrary.IWshShortcut)
    shortcut.TargetPath = target
    shortcut.WorkingDirectory = os.path.dirname(target)
    shortcut.Save()