Windows Command Prompt cm_ExecuteDOS WinExec() ShellExecute

English support forum

Moderators: white, Hacker, petermad, Stefan2

ffFan
Junior Member
Junior Member
Posts: 23
Joined: 2005-12-28, 09:53 UTC
Location: Rheinland-Pfalz

Post by *ffFan »

Win7/32 - TC9.0a

In all cases the dll-file has not been found, but only in the case of commando line window (also über TCMD: Befehle-> "Kommandozeilenfenster öffnen") there is no error message window (what dalai already has mentioned).
User avatar
Dalai
Power Member
Power Member
Posts: 9400
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

ghisler(Author) wrote:Command line sets current directory to the directory of the active panel.
That's why I said in both cases that you need to change directory to the program's directory in the CMD window.
If the program only looks in current directory for the dll, then it will not find it.
This has nothing to do with the program that would complain - Windows does complain because it can't find a required DLL that is part of the EXE's import table; Stefan2 posted the error message.

I had hoped that my description would be accurate enough now. Can you not just try it with VLC, GIMP, Inkscape or any other program that has been mentioned, and see for yourself?

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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I have checked it in the debugger now - "Open command prompt" is a very old functions from the beginning of Windows Commander - it uses WinExec() to open %COMSPEC%. After changing that to ShellExecuteExW, it seems to work fine, I get the complaints from cmd.exe when trying to launch vlc with missing dll. No idea why it doesn't work with WinExec...
Author of Total Commander
https://www.ghisler.com
lucatrv
Junior Member
Junior Member
Posts: 9
Joined: 2014-02-16, 17:29 UTC

Post by *lucatrv »

So I understand that you were able to reproduce the issue and to find a solution, so it is going to be fixed in a next TC release, correct?
Thanks
User avatar
Dalai
Power Member
Power Member
Posts: 9400
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2lucatrv
From my experience: yes, that's exactly what you can expect. And I understand Ghisler's post the same way. It's a pity that this bug has been in TC for so long - maybe you've found the oldest bug in TC.

2ghisler(Author)
Maybe it's time to look through TC's code and replace any other WinExec calls with ShellExecute(Ex). I remember there was a different issue I reported many years ago (regarding files on CD/DVD), although this was caused by missing quotes TC's call of WinExec.

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