In all NT-based Windows, there's a "PATHEXT" environment variable, containing list of extensions. If you enter a command without extension, Windows command line will try each of the extensions. Example: A python script named "hello.py", containing:
Code: Select all
print("Hello, World!")
Code: Select all
Microsoft Windows [Version 10.0.18363.778]
(c) 2019 Microsoft Corporation. All rights reserved.
E:\test>set pathext
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
Code: Select all
Microsoft Windows [Version 10.0.18363.778]
(c) 2019 Microsoft Corporation. All rights reserved.
E:\test>hello
Hello, World!
E:\test>
Thank you