Internal command line not launching the expected binary

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

Moderators: white, Hacker, petermad, Stefan2

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

Post by *ghisler(Author) »

Yes, I could do this, but it could cause other problems, e.g. when the path contains spaces and the name alone doesn't. Maybe as an option.
Author of Total Commander
https://www.ghisler.com
User avatar
szlori
Senior Member
Senior Member
Posts: 263
Joined: 2005-01-17, 07:12 UTC
Location: Sydney

Post by *szlori »

As an option would be perfect!
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

support++ for an option.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
aekeller
Junior Member
Junior Member
Posts: 2
Joined: 2018-06-11, 09:21 UTC
Location: Switzerland

Post by *aekeller »

I also support an option. For me this lauching the exe from the path mentioned next to the cmd-line is a key feature (even the exe is registred as an app).

I found an interesting sequence in MSDN:
Finding an Application Executable

When the ShellExecuteEx function is called with the name of an executable file in its lpFile parameter, there are several places where the function looks for the file. We recommend registering your application in the App Paths registry subkey. Doing so avoids the need for applications to modify the system PATH environment variable.

The file is sought in the following locations:

The current working directory.
The Windows directory only (no subdirectories are searched).
The Windows\System32 directory.
Directories listed in the PATH environment variable.
Recommended: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
So the registry should come last only....

Could the parameter "lpDirectory" from SHELLEXECUTEINFO structure in ShellExecuteEx function have an influence
lpDirectory
Optional. The address of a null-terminated string that specifies the name of the working directory. If this member is NULL, the current directory is used as the working directory.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

aekeller wrote:Could the parameter "lpDirectory" from SHELLEXECUTEINFO structure in ShellExecuteEx function have an influence
lpDirectory
Optional. The address of a null-terminated string that specifies the name of the working directory. If this member is NULL, the current directory is used as the working directory.
This has been clarified already:
Dalai wrote:However, I'm wondering whether or not TC correctly fills the data structure passed to that function, in particular the (current) directory.
ghisler(Author) wrote:Yes, TC does fill the current directory.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
aekeller
Junior Member
Junior Member
Posts: 2
Joined: 2018-06-11, 09:21 UTC
Location: Switzerland

Post by *aekeller »

Dalai wrote:This has been clarified already:
Dalai wrote:However, I'm wondering whether or not TC correctly fills the data structure passed to that function, in particular the (current) directory.
ghisler(Author) wrote:Yes, TC does fill the current directory.
Sorry, I did not properly read it.... Still wondering why the function is not doing it according the documentation...
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2aekeller
Well, Microsoft and documentation is some story, isn't it? Maybe it was like they documented in the past, maybe they changed the behavior, who knows.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply