Windows Explorer Context Menu

Nicodemus nicodemus at globalite.com.br
Fri Dec 13 23:40:00 EST 2002


R.Marquez wrote:

>I have been using the "Send to" Context menu of Windows Explorer to
>pass files as parameters to some small utilities I've written. 
>However, the "Send to" functionality appears to have a predefine
>allowable size for the parameters it passes.  So the deeper the path,
>the less the number of files it can pass without complaining.
>
>So, I am trying to move on to another method of getting the selected
>files as parameters, from Explorer.  I have dug around for a few
>hours, and it seems that I have two options:
>
>1) Somehow getting the files from Explorer through DDE (I have no idea
>where to start on this yet).
>
>2) Writting a context menu extension dll. (I don't think I can do this
>with Python, can I?)
>

Hi!

I don't know about the command line size limitation, but you can create
new menus in explorer rather easily. Just open the regedit, go to the
key HKEY_CLASSES_ROOT, and look for the extesion of the file type that
you want to associate a menu with (you can use Directory for folders or
AllFileSystemObjects for folders and all files). Create then the
following keys:

shell/<command name>/command

And change the value (Default) to the path of your script. Use %1 to
indicate the filename of the file that was right-clicked in explorer:

C:\Bin\myscript.py %1

And that's it.

Hope that helps,
Nicodemus.

>  
>







More information about the Python-list mailing list