I was wondering how to create a shortcut in python to .pyw extensions and .exe's.
-
1What do you mean by a shortcut? Do you want to run a .exe from a Python script?Rafe Kettler– Rafe Kettler2010-11-05 17:20:24 +00:00Commented Nov 5, 2010 at 17:20
-
@Rafe: A .lnk file, like Explorer uses.Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2010-11-05 17:31:25 +00:00Commented Nov 5, 2010 at 17:31
-
hey rafe what i meant was like on my desktop all of those are shortcuts. im making my own installer or more like extracter and i want to code something that will do the same as last clicking on my .pyw file copying it, and pasting pasting the shortcut on desktop. ignacio seems to have the answer thanks :)james– james2010-11-05 17:41:58 +00:00Commented Nov 5, 2010 at 17:41
-
Yeah, I thought you wanted to do something elseRafe Kettler– Rafe Kettler2010-11-05 17:51:59 +00:00Commented Nov 5, 2010 at 17:51
Add a comment
|
1 Answer
You need to create and use a IShellLink via COM.
2 Comments
james
ok one last thing i know this should be asked as a seperate question but its so related i might aswell ask it here. how do i change the icon once i've made this shortcut. thanks it works by the way
Ignacio Vazquez-Abrams
Probably via the
SetIconLocation() method.