Noclose.pif not called for CMD files

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Noclose.pif not called for CMD files

Post by *Flint »

Valid for NT-based Windows versions only - NT/2000/XP/2003/Vista. In Win9x CMD files aren't supported.

1. Create any CMD file (for example with one command DIR inside it).
2. Press Shift+Enter on this file.
3. The console window closes immediately after the batch file is executed (noclose.pif is present and working; Shift key on the keyboard is not broken :) ).

If you just rename the same CMD file into BAT, Shift+Enter immediately begins to work correctly (that is - remain the console window till manual close).

I performed some investigations and found that for CMD files noclose.pif is not called at all (can be easily checked by replacing the noclose.pif with e.g. calc.exe: when you press Shift+Enter on a BAT file, the Calculator appears; when you press Shift+Enter on a CMD file the black console window just quickly appears and closes).
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
iNSiDE
Junior Member
Junior Member
Posts: 23
Joined: 2007-03-27, 19:15 UTC
Location: Belarus, Minsk

Post by *iNSiDE »

Confirmed :P
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm sorry, you cannot use cmd files with noclose.pif. They are executed by cmd.exe and do not work with command.com.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author) wrote:I'm sorry, you cannot use cmd files with noclose.pif. They are executed by cmd.exe and do not work with command.com.
Many users are already using various replacements for this in-highest-degree-out-of-date noclose.pif, either by simply replacing command.com with cmd.exe in the noclose.pif properties, or using my NoClose Replacer. Could you please add possibility of running CMD files via Shift+Enter? You could make it optional, even turned off by default.

The better idea, of course, would be normal support for cmd.exe, but I'm afraid, it's too late for this request in 7.0...
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
karlchen
Power Member
Power Member
Posts: 4605
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

ghisler(Author) wrote:I'm sorry, you cannot use cmd files with noclose.pif. They are executed by cmd.exe and do not work with command.com.
Ever since Windows NT, command.com has been an anachronism.
There is no good reason to use command.com on NT-based Windows versions.
Please, consider preferring cmd.exe over command.com on NT-based systems, or rather use %comspec%.

For the time being, I recommend replacing noclose.pif by NoClose Replacer 1.2.

Oh yes, NoClose Replacer will launch .BAT .and CMD script files using cmd.exe.

Ciao,
Karl
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately .pif files only work with DOS programs like command.com, but not with Win32 programs like cmd.exe. Any ideas?
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3501
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author) wrote:Unfortunately .pif files only work with DOS programs like command.com, but not with Win32 programs like cmd.exe. Any ideas?
That's why I said about options. If the user has replaced noclose.pif with anything that allows executing Win32-programs (NoClose Replacer for example is a usual Win32 program, not a PIF file, and of course it can run any other Win32 programs including cmd.exe), he can set the option to tell TC that CMD files can now be started with noclose.pif without any problem.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
petermad
Power Member
Power Member
Posts: 16027
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Unfortunately .pif files only work with DOS programs like command.com, but not with Win32 programs like cmd.exe
Maybe I misunderstand you, but here on my Win XP SP2 noclose.pif works with both cmd.exe and %COMSPEC% set as the command.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply