[Feature Suggestion] TC Command Line Improvements

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

[Feature Suggestion] TC Command Line Improvements

Post by *jb »

I suggest the following new options for the TC Command Line in [Configuration] of wincmd.ini:

[face=courier]CmdPrefixEnter
CmdPrefixShiftEnter
[/face]

CmdPrefixEnter could be used to specify the command shell (including zero or more of its switches) that will be invoked by TC to execute external commands when the TC command line is not empty and the user presses the Enter or Return key. (TC-internal commands are cd, md, rd and perhaps a few more.)
CmdPrefixShiftEnter would have the same meaning except that it will be used only when the user presses Shift+Enter or Shift+Return.


I think the settings for the current behavior would be:
[face=courier]CmdPrefixEnter=command.com
CmdPrefixShiftEnter=command.com /c[/face]

The current behavior with Shift+Enter has the following drawbacks (at least on Windows 2000):
1. You cannot call .exe files with an explicit directory specification.
(It works only if the .exe file is specified without its directory and the directory specification is in %PATH%).
2. You cannot call .bat or .cmd files (with or without explicit directory specification).
3. command.com is a 16-bit program and runs within ntvdm.exe (NT virtual DOS machine).


My preferred settings would be:
[face=courier]CmdPrefixEnter=%ComSpec%
CmdPrefixShiftEnter=%ComSpec% /k[/face]

%ComSpec% is a Windows-defined environment variable. On Windows 2000 its value is something like
[face=courier]>set comspec
ComSpec=D:\WINNT\system32\cmd.exe[/face]

BTW: Currently the cm_ExecuteDOS command also calls %ComSpec%.
Last edited by jb on 2003-02-18, 16:22 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Currently ENTER uses %comspec%, while Shift+Enter uses noclose.pif. You can change noclose.pif with Alt+Enter.
Author of Total Commander
https://www.ghisler.com
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

Thanks! It works, although in this way %ComSpec% is invoked by ntvdm.exe.
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

ghisler(Author) wrote:Currently ENTER uses %comspec%, while Shift+Enter uses noclose.pif. You can change noclose.pif with Alt+Enter.
IMHO, installation procedure should copy one of two noclose.pif depending on OS, pointing either to command.com or to cmd.exe, because not all people understand what's this and why it should be changed and how.
Last edited by Valentino on 2003-02-23, 10:02 UTC, edited 1 time in total.
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 22-02-2003 20:29:30 +0000 Valentino wrote:

V> IMHO, installation procedure should copy on of
V> two noclose.pif depending on OS, pointing either
V> to command.com or to cmd.exe


Correct me if I wrong, but NT starts ntvdm.exe for any application ran via PIF regardless on command interpreter you set there. I think it's a good idea to implement user defined prefix command instead of PIF as jb suggested.[/face]
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

2Black Dog
Maybe. Didn't thought about the performance... I just wanted to point out that noclose.pif which comes with TC by default doesn't work under NT4.
But... Won't ntvdm.exe be called if prefix will contain cmd.exe (or command.com)? Seems the same...
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

Valentino wrote:Won't ntvdm.exe be called if prefix will contain cmd.exe (or command.com)? Seems the same...
No, it is not the same thing. COMMAND.COM is a 16-bit program and therefore NT calls ntvdm.exe first. CMD.EXE is a 32-bit program and will be started directly (as it already happens when you use cm_ExecuteDOS).
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

jb wrote:Thanks! It works, although in this way %ComSpec% is invoked by ntvdm.exe.
Black Dog wrote:Correct me if I wrong, but NT starts ntvdm.exe for any application ran via PIF regardless on command interpreter you set there.
You are right. That 's what my previous post implies.
User avatar
Valentino
Power Member
Power Member
Posts: 706
Joined: 2003-02-07, 00:21 UTC
Location: Ukraine

Post by *Valentino »

Now clear. But nevertheless smth must be done to make Shift+Enter work on NT4 by default.
Post Reply