My goal: to run a file hello.py
on my %PATH% when I write hello
.
What I've done:
- Made sure
.py
is part ofPATHEXT
.
C:\Windows\System32>echo %PATHEXT%
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYZ;.PYW
- Made sure
.py
is associated with the ftypePython.File
and thatPython.File
is associated with my Python installation.
C:\Windows\System32>ftype | findstr -i python
Python.File="C:/Users/gal/scoop/apps/python311/current/python.exe" "%1" %*
C:\Windows\System32>assoc .py
.py=Python.File
- Made sure
hello.py
is on my %PATH% and that it executes correctly when I manually specify the Python executable, including taking arguments.
C:\Windows\System32>where hello
c:\path\hello.py
C:\Windows\System32>C:\Users\gal\scoop\apps\python311\current\python.exe c:\path\hello.py George Elaine
Hello, George and Elaine
Based on everything I'm reading this should be enough for it to work, but when I run hello.py
or hello
I get "Access is denied".
What am I doing wrong?
icacls
show about it?