1

On Windows, I have an executable that depends on some third-party libraries.

If I try to run it under cmd, an error windows appear saying "program can't start because some_third_party_library.dll is missing"

However if I try to run it under a cmd with administrative privileges, the libraries are loaded correctly and the program starts.

Looking on my system variables, these libraries path are placed inside the %Path% variables and even inside the user %Path% variable. I've check it with echo %Path%

At first, I though that it was related to some permission reason so I bring Full Control to all users, but it didn't works.

So, ¿why I need to execute that program from console with administrative privileges?

2
  • The error message states it's missing, maybe the program only looks in the current folder - so from where do you run the exe?
    – LotPings
    Commented Apr 26, 2017 at 14:16
  • But when I run the same executable as administrator the system is able to find them, even though they were placed on their own folder. My doubt is why some times the system can't find they, and magically they are found when I bring the administrators right. So I don't believe that is a folder/path related problem. May be something related to permissions... Or user/system variables... Commented Apr 28, 2017 at 10:11

1 Answer 1

1

Your user account might not have the permission of "Read & execute" on these DLLs.

Right-click one such DLL, choose Properties, Security tab, and verify the permissions for your account or for the generic Users account. You may add permissions by using the Edit button.

For more information see this Microsoft article.

2
  • I've already said "At first, I though that it was related to some permission reason so I bring Full Control to all users, but it didn't works " so your answer didn't say anything new. But thank you for your comment, maybe it would be useful to some people. Commented Apr 28, 2017 at 10:04
  • There cannot be any other explanation for the difference except permissions. If you cannot see any permission problem, this does not mean that there isn't one. A DLL is more than just a file that is read by the program. The DLLs themselves might require other DLLs, which you could verify by using the Dependency Walker. The DLLs might also do some actions on load for which your account does not have permission, and that failure is misleadingly reported by Windows as a load failure of the DLL itself.
    – harrymc
    Commented Apr 28, 2017 at 10:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .