

def create_shortcut(path, description, filename, arguments='', workdir='', iconpath='', iconindex=0):
    'Create Windows shortcut (.lnk file)'
    import pythoncom
    from win32com.shell import shell
    ilink = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink)
    ilink.SetPath(path)
    ilink.SetDescription(description)
    if arguments:
        ilink.SetArguments(arguments)
    if workdir:
        ilink.SetWorkingDirectory(workdir)
    if (iconpath or iconindex):
        ilink.SetIconLocation(iconpath, iconindex)
    ipf = description.QueryInterface(pythoncom.IID_IPersistFile)
    if (not filename.endswith('.lnk')):
        filename += '.lnk'
    ipf.Save(filename, 0)

dataset/ETHPy150Open winpython/winpython/winpython/utils.py create_shortcut/VarMisuse@124/180 `ilink`->`description`