Is there any shell extension for Explorer that would execute text files with a
#! shebang at the beginning?
You're very much in conflict with the Microsoft model for files. In the POSIX model, the filename doesn't dictate whether a file is executable, at all. That's solely the province of the permissions. In the Microsoft model used in Windows Explorer, whether a file is executable is also determined by its filename, in particular by the extension. Hence the
FTYPE command, the
ASSOC command, the
PATHEXT environment variable, and so forth.
So, with the proviso that this is restricted to files with the
.CMD extension, in order to fit in with the aforementioned model, there actually is an extension that will pass files beginning with
#! to the script interpreter named on that line. It's JP Software's TCC, a replacement command interpreter which has both
EXTPROC support. Explorer can be told to hand off all
.CMD files to TCC, which in turn will read the
#! and hand off to the named script interpreter.
If you want to use
#! with any other file extensions in Explorer, then you hit the paradigm conflict, and you'll have to switch to using file extension associations, just like the person with the CGI script did in the article hyperlinked-to by
new123456. Extension determining script interpreter, not magic numbers in file contents, is the paradigm that Windows Explorer uses.