[Submitted to superuser two days ago, but nobody could answer it, so reposting here.]
Working on the basis of this post (and this follow-up post), I've tried adding a python script (which I've added to the path and so on, so that I can run it from the command line everywhere in the system) to the context menu, like this:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\get_abs]
@="&Get Abstracts"
"Icon"="%SystemRoot%\\System32\\shell32.dll,71"
[HKEY_CLASSES_ROOT\Directory\Background\shell\get_abs\command]
@="C:\\cmdtools\\get_abs.py"
However, I get a strange error message when I try to run it.
To be clear, I have successfully run this script from the command line (using powershell, in case it matters) in the folder in which I'm trying to run it from the context menu.

commandkey needs to point to an actual executable, e.g..exefile. Try it with the path to your Python interpreter followed by the script path.%1for the file being passed in (which would go at the end, with another space before it).