I’ve never had this happen before. My old laptop is WIndows 10 Home and the new one is Windows 11 Home. I have a number of python scripts in D:\Utils that I can run from anywhere by typing the file name with no extension. While I can do the same on the new laptop, the scripts now do not recognize command line parameters. If I run the scripts by first typing ‘python’ then adding the script I can get access to the parameters, however if I do this then I always have to fully qualify the script name. It shouldn’t work this way. Can anyone suggest how to fix this? Obviously I have added .py and .pyw to %PATHEXT%. I suspect this is merely a “senior” moment and I have just forgotten something trivial.
D:>type test.py
import sys
print(f’{len(sys.argv)=}‘)
print(f’{sys.argv=}')
D:>
D:>
D:>
D:>test
len(sys.argv)=1
sys.argv=[‘D:\test.py’]
D:>
D:>
D:>
D:>test a b c
len(sys.argv)=1
sys.argv=[‘D:\test.py’]
D:>python test.py a b c
len(sys.argv)=4
sys.argv=[‘test.py’, ‘a’, ‘b’, ‘c’]