Windows 10: My EXE does not follow the PATH environment variable to find my DLL.

Discus and support My EXE does not follow the PATH environment variable to find my DLL. in Windows 10 Support to solve the problem; With the Microsoft Visual Studio 2019 Enterprise Edition, I created two projects in C++. In the first project, I created "dynamic link library" (.dll)... Discussion in 'Windows 10 Support' started by Erez, Jul 29, 2019.

  1. Erez Win User

    My EXE does not follow the PATH environment variable to find my DLL.


    With the Microsoft Visual Studio 2019 Enterprise Edition, I created two projects in C++.

    In the first project, I created "dynamic link library" (.dll) and "import library" (.lib) files.
    In the second project, I created an executable (.exe) file.

    In the CPP file (that was used to create the executable file in the second project) I wrote the #pragma comment lib statement to refer to the import library file from the first project and now the executable from the second project must find the dynamic link library from the first project in order to run.

    If the executable and the dynamic link library files are in the same folder then the executable finds the dynamic link library and it runs, but otherwise the executable does not find the dynamic link library and does not run.

    I put the executable and the dynamic link library in two different folders and added new string to the PATH environment variable, so my executable can find my dynamic link library, even when the dynamic link library is not in the folder that the executable is in.

    But when I did that, my executable still does not find my dynamic link library and still does not run.

    According to this MSDN document https://docs.microsoft.com/en-us/win...fect-searching

    is in the
    No matter whether SafeDllSearchMode is enabled or disabled.

    When I specified the location and the name of the folder that my dynamic link library is in the PATH environment variable and according to this MSDN page, I expected that my executable will be able to find my dynamic link library and run, but my expectation does not happen.

    It seems like that my executable simply ignores the PATH environment variable.

    What am I doing wrong?

    :)
     
  2. MCK
    mck Win User

    System environment variable won't stick


    Running Win10 Home on an Acer Spin 3, 64bit, i7cpu. I try to add a path to the system environment variables by:

    1. Control Panel > System > Advanced system settings > Advanced tab > Environment variables

    2. The "Environment Variables" window opens.
    3. In the "System Variables" pane I select "Path" and click the EDIT button.
    4. A list of the current system paths is displayed.
    5. I click the NEW button, browse to the path I want to add which is "C:\Python36-32" and click OK. The path "C:\Python36-32" is added to the list of current system paths.
    6. I click OK and am returned to the "Environment Variables" window.
    7. I click the "X" at the top right to close the "Environment Variables" window.

    Now if I click the "Environment Variables" button again (end of step-1) and repeat steps 2-4, the new path I added in step-5 is gone. IOW, adding a new path won't stick.

    What am I doing wrong?
     
  3. Searching environment variable in list

    I'm using a command that gives me a list of environment variables. When searching in the list, I want to find all environment variables with the word
    EXTERNAL; using the following command all that is occurring is all the environment variables are being listed instead of those environment variables with the word
    EXTERNAL ?

    findstr /c "EXTERNAL"
     
    StraightWorld, Jul 29, 2019
    #3
  4. My EXE does not follow the PATH environment variable to find my DLL.

    Accidentally deleted the path of environment variables

    I accidentally deleted the path of system environment variables, instead of editing it and adding a new one, in my Windows 10 Dell Laptop. I lost all the default variables that were there. How do I restore the previous variables? Please help
     
    AishwaryaC, Jul 29, 2019
    #4
Thema:

My EXE does not follow the PATH environment variable to find my DLL.

Loading...
  1. My EXE does not follow the PATH environment variable to find my DLL. - Similar Threads - EXE does follow

  2. environment variables

    in Windows 10 Software and Apps
    environment variables: Cant get the modal window when editing my system variables from the environment variables areai get this windowand i want this window https://answers.microsoft.com/en-us/windows/forum/all/environment-variables/07d24fc8-345d-4062-8169-3fa9bb16a049
  3. environment variables

    in Windows 10 Customization
    environment variables: Hi, another question from a noob. I see in my PC environment variables at the bottom of the list a sole entry called ZES_ENABLE SYSMAN 1 .I am a sole PC home windows 10 user who only really games a lot. Should this be here, i can only find entries for this in the...
  4. set path in windows 10 for environment variables

    in Windows 10 Customization
    set path in windows 10 for environment variables: Set path in windows 10 https://answers.microsoft.com/en-us/windows/forum/all/set-path-in-windows-10-for-environment-variables/b608e15a-4994-4d1a-ae4e-1d220293dc22
  5. Multiple PATH environment variables

    in Windows 10 Ask Insider
    Multiple PATH environment variables: [ATTACH] There's a package that I want to install and it says in order to install it, it needs to be added to the PATH. Upon checking my environment variables, I noticed there are three of them as shown:...
  6. regarding path variable of user variable of environment variable

    in Windows 10 Customization
    regarding path variable of user variable of environment variable: please help me fast, I accidentally deleted path variable of user variable ..... I want to restore it. the real situation is I cannot run android studio project and it shows error - " unable to start daemon process............This problem might be caused by incorrect...
  7. environment variable

    in Windows 10 Customization
    environment variable: What would happen when we deleted all the environment variable system directory. https://answers.microsoft.com/en-us/windows/forum/all/environment-variable/723a4cb6-5baf-4907-a56b-614f35d77da5
  8. Setting path variable in Environment variables Windows 10

    in Windows 10 Customization
    Setting path variable in Environment variables Windows 10: How can I stack up multiple path variables? Currently, it overwrites the old one when I try to edit. (I believe mindless updates are bad and updates should only happen when it is reasonably certain they will improve usability, and not just so that some people have a job.)...
  9. Automated modification of PATH environment variables

    in Windows 10 Performance & Maintenance
    Automated modification of PATH environment variables: The following archive contains scripts to safely edit the "Path" values in HKCU and HKLM. Useful to run after a new installation. path.7z New path inclusions are specified in "path.txt". Run "path.bat" to commit any changes. 103736
  10. Reset Java Environment Variable Path

    in Windows 10 Support
    Reset Java Environment Variable Path: I had to restore my PC to factory settings because of a virus (maybe overkill, not sure) and reinstalled the Java JDK and editing the Environment Variable for Path. First try gave me this: [img] Second try gave me this (I can't remember how): [img] I'm trying...

Users found this page by searching for:

  1. path of exe to find dlls