Using Python scripts in Windows Explorer

richard.charts at richard.charts at
Fri Oct 20 21:15:50 CEST 2006

Ben Sizer wrote:
> I'd like to be able to drag a file onto a Python script in Windows
> Explorer, or send that file to the script via the Send To context-menu
> option, so I can then process that file via sys.argc.
> Unfortunately, I can't drag items onto the Python script, because
> Windows doesn't recognise that the script is executable (unless I
> double-click it, upon which it runs as usual, without the command line
> parameter of course) and won't set it as a drop target. And it won't
> even appear in the Send To menu after the usual steps are taken to get
> it there.
> I then tried to wrap it in a batch file, but encounter a problem, where
> that batch file is able to execute the Python file if I double-click
> the batch file, but if I drag a file onto it it says it can no longer
> find the Python script.
> Are there any simple and workable solutions for this sort of thing?
> --
> Ben Sizer

I didn't even know you could do that at all, but my suggestiong would
be compile the python  script into an executable and try that.
If you get it working, update here as I am interested in your solution.

More information about the Python-list mailing list