Is there a simple way to create shortcuts in Windows 7 on Python? I looked it up online but they did not seem that simple.
I have tried using this simple method:
<
@Casey answer put me on the right track, but I wasted a lot of time before figuring out that you also need to set the working directory (called 'start in' in windows properties). If you do not, your shortcut will work but your application will not find the files it may need from the same folder.
This resolved all my issues:
path_input = ''
path_output = ''
path_cwd = ''
path_icon = ''
shell = win32com.client.Dispatch("WScript.Shell")
shortcut = shell.CreateShortCut(path_output)
shortcut.Targetpath = path_input
# shortcut.IconLocation = icon
shortcut.Workingdirectory = path_cwd
shortcut.WindowStyle = 1 # 7 - Minimized, 3 - Maximized, 1 - Normal
shortcut.save()