Shift+Enter for apps inside of archives makes wrong cmdline

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Shift+Enter for apps inside of archives makes wrong cmdline

Post by *MVV »

I found a bug, it exists in TC 7.50a and 7.56a but doesn't exist in TC 7.04a.

When you using Shift+Enter on executables inside of archives TC builds incorrect command line and executes it. In fact, TC doubles command line that should be normally executed.

E.g. if I have a file C:\1.bat and I'm using Shift+Enter on it, TC executes following command line:

Code: Select all

NOCLOSE.PIF /C C:\1.bat
But if I pack same file into archive C:\1.zip, enter archive and use Shift+Enter on 1.bat (via Unpack and execute), TC tries to execute following command line:

Code: Select all

NOCLOSE.PIF /C D:\TEMP\_tc\1.bat NOCLOSE.PIF /C D:\TEMP\_tc\1.bat
So, target program gets wrong command line parameters.


You may check it using your own noclose.pif that will show a message box with command line parameters or you may create special batch file for tests and use default TC's noclose.pif.

1.bat contents:

Code: Select all

@echo off
echo %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
pause
cls
When you start this batch file using Shift+Enter from C:\1.bat you should see in command line something like:

Code: Select all

C:\1.bat
Press any key to continue . . .
But if you start this batch file from archive... you should see garbage at command line:

Code: Select all

D:\TEMP\_tc\1.bat NOCLOSE.PIF /C D:\TEMP\_tc\1.bat
Press any key to continue . . .
So batch gets garbage parameters NOCLOSE.PIF /C D:\TEMP\_tc\1.bat.



I tried this in 7.04a - all works as expected, it doesn't double string.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3295
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

Confirmed
Plus if you dont have the file "noclose.pif"
(who really works with dos these days under windows? ^^)
you get only an error message saying file not found....
Hoecker sie sind raus!
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Sir_SiLvA wrote:Plus if you dont have the file "noclose.pif"
(who really works with dos these days under windows? ^^)
you get only an error message saying file not found....
Yes, it is a known behaviour - TC starts this special link file on Shift+Enter (BTW, under x64 it is impossible because it doesn't support 16-bit apps). But you may use noclose replacer (e.g. this) - executable that is placed instead and may start normal cmd.exe.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Strange, I will check it.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I have checked this under 7x64 and XPx32, even with clean INI.
Post Reply