124 @param targetPath path the shortcut shall point to |
124 @param targetPath path the shortcut shall point to |
125 @type str |
125 @type str |
126 @param iconPath path of the icon file |
126 @param iconPath path of the icon file |
127 @type str |
127 @type str |
128 """ |
128 """ |
129 from pywintypes import com_error # __IGNORE_WARNING_I102__ |
129 from pywintypes import com_error # __IGNORE_WARNING_I-102__ |
130 from win32com.client import Dispatch # __IGNORE_WARNING_I102__ |
130 from win32com.client import Dispatch # __IGNORE_WARNING_I-102__ |
131 |
131 |
132 with contextlib.suppress(com_error): |
132 with contextlib.suppress(com_error): |
133 shell = Dispatch("WScript.Shell") |
133 shell = Dispatch("WScript.Shell") |
134 shortcut = shell.CreateShortCut(linkPath) |
134 shortcut = shell.CreateShortCut(linkPath) |
135 shortcut.Targetpath = targetPath |
135 shortcut.Targetpath = targetPath |