Totally sure-fire. Absolutely prevents any execution until it's
renamed. By the way, what does "associate" mean, and what does it have
to do with file names?
Windows-speak...
Where UNIX/Linux relies upon the first line of a script to identify
what executable is used to process it (the #! line), Windows uses a linked
pair of registry entries
C:\Users\Wulfraed\Documents>assoc .py
..py=Python.File
C:\Users\Wulfraed\Documents>ftype python.file
python.file="C:\PYTHON~2\Python27\python.exe" "%1" %*
C:\Users\Wulfraed\Documents>
"ftype" takes a type label and defines the command line used to execute
that file type (or otherwise open the file... ).
"assoc" takes a file extension and "associates" it with the type label
-- allows multiple extensions to be linked to one command line
..py=Python.File
..pyc=Python.CompiledFile
..pyo=Python.CompiledFile
..pys=pysFile
..pyw=Python.NoConFile
Python.CompiledFile="C:\PYTHON~2\Python27\python.exe" "%1" %*
Python.File="C:\PYTHON~2\Python27\python.exe" "%1" %*
Python.NoConFile="C:\PYTHON~2\Python27\pythonw.exe" "%1" %*
(No idea where .pys came from -- it has no defined executor)
These are how one can do things like
C:\Users\Wulfraed\Documents>scite t.py
C:\Users\Wulfraed\Documents>python t.py
Goodbye
C:\Users\Wulfraed\Documents>t.py
Goodbye
C:\Users\Wulfraed\Documents>t
Goodbye
There's another environment variable that defines what order to search
extensions when not provided (as in the last sample above), as one may have
a t.py, t.bat, t.doc, etc.
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw
Hmmm, think I need to edit that... shove the .py* behind .bat -- I don't
use the others so why have the system try to find them first. I'd add
powershell but its designed for security and pretty much needs to be
manually invoked.