0

I was wondering how to create a shortcut in python to .pyw extensions and .exe's.

4
  • 1
    What do you mean by a shortcut? Do you want to run a .exe from a Python script? Commented Nov 5, 2010 at 17:20
  • @Rafe: A .lnk file, like Explorer uses. Commented 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 :) Commented Nov 5, 2010 at 17:41
  • Yeah, I thought you wanted to do something else Commented Nov 5, 2010 at 17:51

1 Answer 1

2

You need to create and use a IShellLink via COM.

Sign up to request clarification or add additional context in comments.

2 Comments

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
Probably via the SetIconLocation() method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.