Running a script from a windows right click menu..?

N

Nuff Nuff

I wrote a little script that affects a bunch of files in the folder
that it is run in.

Now what I want to do is to make it run from the right click menu but
I don't know how.

Would you give me an example script that will simply print the
woriking directory, and show me how to add that to the right click
menu in windows explorer?

TIA

Nuffi
 
G

Gabriel Genellina

I wrote a little script that affects a bunch of files in the folder
that it is run in.

Now what I want to do is to make it run from the right click menu but
I don't know how.

Would you give me an example script that will simply print the
woriking directory, and show me how to add that to the right click
menu in windows explorer?

In the Windows registry, add a new key under
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell
Make its default value the item text you want in the context menu.
Add a new key under it, "command", and make its default value the command
line you want to execute. Will look like this:
"path to python.exe" "path to your script.py" %1 %*

See http://msdn.microsoft.com/en-us/library/dd807139(VS.85).aspx for more
details
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top