Page 1 of 1

Feature request: PATHEXT

Posted: 2020-05-12, 06:25 UTC
by Ladik
Hi,

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!")
Since I have Python installed on my PC, there's ".PY" extension included in the "PATHEXT" variable:

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
Because of that, I can run the script by entering just "hello":

Code: Select all

Microsoft Windows [Version 10.0.18363.778]
(c) 2019 Microsoft Corporation. All rights reserved.

E:\test>hello
Hello, World!

E:\test>
Total Commander v 9.50 does support "hello.py", but it doesn't support "hello". It would be a nice feature.

Thank you

Re: Feature request: PATHEXT

Posted: 2020-06-12, 17:25 UTC
by mbch331
I requested this in https://www.ghisler.ch/board/viewtopic.php?f=3&t=72039 but in my case it's for PHP files.

Re: Feature request: PATHEXT

Posted: 2020-07-02, 19:33 UTC
by vdijken
TC has a perfect alternative for this; when you start typing a "h" in the command line bar, a list of files in the current directory starting with "h" pops up. When you think there are too much you type additional letters. Click on "hello.py"; the name is copied into the command bar. Hit the "Enter" key and it works.

Re: Feature request: PATHEXT

Posted: 2020-07-02, 19:38 UTC
by Hacker
[mod=Hacker]Moved to the Suggestions forum.[/mod]

Re: Feature request: PATHEXT

Posted: 2020-07-03, 06:00 UTC
by mbch331
vdijken wrote: 2020-07-02, 19:33 UTC TC has a perfect alternative for this; when you start typing a "h" in the command line bar, a list of files in the current directory starting with "h" pops up. When you think there are too much you type additional letters. Click on "hello.py"; the name is copied into the command bar. Hit the "Enter" key and it works.
This works when the script you're running in the same folder, but in my use case,the scripts aren't in the folder I'm running them from (only the files the script works on)