Error executing program! (5)

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

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
pdavit
Power Member
Power Member
Posts: 1525
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Error executing program! (5)

Post by *pdavit » 2011-11-11, 22:04 UTC

On Windows XP SP3 (32bit) when you try to run e.g. an executable file for installation you get the typical Security Warning dialog to verify Run or Cancel of the execution.

If you click Cancel then Total Commander returns:

Error executing program! (5)

Not an issue per se but I don't really see the point of the message. I would have expected that the correct TC behaviour would be to just returned the focus to the file panel the executable file has been initially run without any further actions or dialog boxes.

This is the regular behaviour of the Windows Explorer anyway. The dialog is a TC message and not Windows generic and seems to capture incorrectly a problematic and not a canceled file execution.
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!

Biozynotiker
Member
Member
Posts: 161
Joined: 2011-03-22, 09:57 UTC
Location: Germany

Post by *Biozynotiker » 2011-11-12, 09:02 UTC

I think the "Error" message is the right way.
TC tries to run an Executable, you canceled the UAC process, and TC gets no correct returncode from started Execuatble back, because its never really started.
#92832 - I had never used a TC plugin in the past and I won't do it in the future. I'm proud of it. Period.
(Please don't take my English too serious, I know it is "sergeant" like!)

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

Post by *ghisler(Author) » 2011-11-13, 15:54 UTC

This is intentional - I get back an error 5 (Access is denied) when the user clicks on "Cancel". There is no way to distinguish this case from a case where the user doesn't have the rights to access a file.
Author of Total Commander
http://www.ghisler.com

User avatar
pdavit
Power Member
Power Member
Posts: 1525
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit » 2011-11-13, 17:36 UTC

I understand the technicality behind it but since the only option you have is to click an OK button why display the message in the first place especially when the source if the problem is not distinguishable? User actions is the only clue I presume.

Windows Explorer doesn't have the same behaviour, you get back to the file list without a message. Of course TC doesn't have to follow Windows Explorer.

May I suggest a more meaningful and/or generic message if cannot be removed? It could read for example:

'Program execution canceled, problematic or no access rights'

Just a thought. Thank you.
"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!

User avatar
Flint
Power Member
Power Member
Posts: 3167
Joined: 2003-10-27, 09:25 UTC
Location: Moscow, Russia
Contact:

Post by *Flint » 2011-11-14, 06:30 UTC

pdavit wrote:why display the message in the first place especially when the source if the problem is not distinguishable?
Suppose, there is an EXE file the user doesn't have permissions to launch. He tries to start it, TC gets the error code 5 (access denied) — the same as when the file was started, but user cancelled the UAC prompt. If TC does not show a message box, it's a doule-sided effect: in "UAC cancelled" situation the user does not have excessive message box — that's fine, but in the real "no access" problem he also will not have any explanation. He pressed Enter on a file — and absolutely nothing happens! He will try again and again, until drops TC and tries to start from Explorer which will finally tell him the source of the problem.

Of course, it would be much more preferrable to show message when access is denied and not show it when UAC was cancelled, but at the moment I don't see how this could be done, and how Explorer does this. Maybe, it uses some undocumented method, or maybe it's itself responsible for showing the UAC prompt, and therefore can have more information about user's actions in it.
pdavit wrote:'Program execution canceled, problematic or no access rights'
This I support. Christian could even use FormatMessage function to translate all the error codes into the text description by the system (however, it will follow the OS language settings and not TC's).
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 9.21a / Win7 x64 SP1, Win10 x64

gbaii
New Member
New Member
Posts: 1
Joined: 2012-01-11, 21:01 UTC
Location: Romania
Contact:

Same error executing program! (5)

Post by *gbaii » 2012-01-11, 21:19 UTC

Hey guys!
I begin by saying that Total Commander is a really great and powerful tool. So thank you for that.

Now for the problem... Since I installed Windows 7 Ultimate with SP1 64 bit, this error appear. I mention that I run in Administrator mode. Windows explorer doesn't do me any problem. On system partition i have no problems getting into any folder, but when i try to access folders from the 2nd and 3rd partition, 1st time i always get the message saying that "Access denied on file d:\b...!" (OK and As Administrator). If i click ok, it doesnt let me access that folder and if i click "As Administrator" I am able to access it, but then on any file I click to run it, I get the message shown in the subject. As i said, i dont have the same problem using windows explorer and I didnt had the same problem before, when I was using windows XP sp3.
The UAC is set on "Notify me only when programs try to make changes to my computer".
If I quit Total Commander and then try to using it again, accesing a folder (any), I get the same message "Access denied on file d:\b...!"

What is going on, please?

Thank you.
Gabriel

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

Post by *ghisler(Author) » 2012-01-12, 14:37 UTC

You should right click on the files/folders and open the properties - then go to the permissions tab and take over the ownership of the files/folders.
Author of Total Commander
http://www.ghisler.com

umbra
Power Member
Power Member
Posts: 784
Joined: 2012-01-14, 20:41 UTC

Post by *umbra » 2013-01-30, 13:11 UTC

Hi, about canceling the UAC dialog - how about using GetLastError()?
If ShellExecute() returns SE_ERR_ACCESSDENIED and GetLastError() returns ERROR_CANCELLED, it should mean that user dismissed some security dialog (UAC or any other) and there should not be a need to show another dialog with error in TC.
I've seen this in some example codes (from Microsoft) for dealing with UAC.
Windows 7 Pro x64, Windows 8.1 Pro x64, Windows 10 Pro x64

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

Post by *ghisler(Author) » 2013-01-31, 14:07 UTC

Nice idea, I will add it! I didn't know that GetLastError returns something useful here...
Author of Total Commander
http://www.ghisler.com

Post Reply