Windows Explorer Context Menu

R.Marquez ny_r_marquez at yahoo.com
Mon Dec 16 08:42:50 EST 2002


Nicodemus,

Thanks for the reply.  However, what I need is a way to pass _all_
selected items from Windows Explorer to my program, not just one.  It
seems that there is no easy way to do this.  Think of how, for
example, Winzip dos it.  You select all the files you want it to
archive, right click, select the Winzip option, and it does it.  This
tells me that it is doable, but can it be done with Python?  If so,
how?

-Ruben

Nicodemus <nicodemus at globalite.com.br> wrote in message news:<mailman.1039837283.7446.python-list at python.org>...
> 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