Feature request: PATHEXT

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Ladik
Junior Member
Junior Member
Posts: 3
Joined: 2003-09-10, 06:37 UTC

Feature request: PATHEXT

Post 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
mbch331
Junior Member
Junior Member
Posts: 3
Joined: 2020-06-05, 17:31 UTC

Re: Feature request: PATHEXT

Post 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.
User avatar
vdijken
Member
Member
Posts: 181
Joined: 2016-07-30, 14:07 UTC
Location: The Netherlands

Re: Feature request: PATHEXT

Post 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.
Last edited by vdijken on 2020-07-02, 19:42 UTC, edited 1 time in total.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Feature request: PATHEXT

Post by *Hacker »

[mod=Hacker]Moved to the Suggestions forum.[/mod]
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
mbch331
Junior Member
Junior Member
Posts: 3
Joined: 2020-06-05, 17:31 UTC

Re: Feature request: PATHEXT

Post 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)
Post Reply