Can I "register" python scripts to execute on Windows?

Yes :) That's actually FAQ #2:

If you'd rather be able to execute the script by simple typing 'foo' with no extension you need to add .py to the PATHEXT environment variable.

Edit: Of course, don't forget to add the Python install directory to the PATH, and to launch another instance of your command interpreter if you modify the systemwide or the user PATH and/or PATHEXT by means outside of that command interpreter.

Further edit: In case I misunderstood your question: I'm assuming you're only interested in launching python scripts without having to type in the .py extension from the cmd.exe command line. PATHEXT is a mechanism specific to the cmd.exe shell and other shells (as well as CreateProcess() and friends) won't care about it in the least.


I had exactly the same issue with PHP.

http://php.net/manual/en/install.windows.legacy.index.php#install.windows.legacy.commandline (Edit: Seems command line usage for PHP is now "legacy")

One thing that I found was being able to use PHP scripts as filters ...

DIR C:\ | scripts\script | more

(for example - where scripts\script is a PHP script - NOTE : No PHP reference).

The registry change is required for this. Works for all of those interpreter type languages on windows (PHP, Python, Perl, Ruby).