PDA

View Full Version : Where does Windows look for DLL's


bractals
02-07-2002, 11:44 PM
I am running Win98se.
If a batch file in folder \DIR_BAT executes an .exe file in folder \DIR_EXE and that .exe file needs a .dll file that is not in memory and no hard coded path is given, then in what folders does Windows look for the .dll file and in what order?

Cricket
02-08-2002, 12:00 AM
Hi bractals,

Windows system .dll's are kept in c:\Windows\System.

If you need to find a .dll for a particular program, do a search (Start> Find) and once found it will give you the path to that directory and folder.

:) Cricket

bractals
02-08-2002, 01:13 AM
Hi Cricket,

I guess I didn't ask the question correctly. Lets say there is a different version of the .dll file in the following four folders: \DIR_BAT, \DIR_EXE, \WINDOWS, and \WINDOWS\SYSTEM - Which folder will Windows load the .dll file from?

:confused: bractals

morriswindgate
02-08-2002, 02:00 AM
One of the problems, that has always caused problems in windows was programs replacing the windows supplied .dlls with their own. This has been corrected to a certain extent in XP. The problem is that the .dll that say Norton Utilities installs overwrites the existing one that several other programs are using which then leads to problems with those programs running. My suggestion is, that unless you are having problems the duplicate .dlls are doing their jobs correctly and just leave them. Also, in my way of thinking, if these so called .dlls were true duplicates windows would overwrite them when the installation was done.

bractals
02-08-2002, 01:32 PM
Hi All,

Maybe the following will help clarify my problem.

Lets say that I execute the application FOO in the folder \FOO_FOLDER and it needs BAR.DLL to be loaded and no path to BAR.DLL is given. Consider the following scenarios presented to Windows:

Scenario 1)

\FOO_FOLDER\FOO.BAR (Old version)
\WINDOWS\SYSTEM\ (No version)

Scenario 2)

\FOO_FOLDER\ (No version)
\WINDOWS\SYSTEM\FOO.BAR (Old version)

Scenario 3)

\FOO_FOLDER\FOO.BAR (Old version)
\WINDOWS\SYSTEM\FOO.BAR (New version)

Scenario 4)

\FOO_FOLDER\FOO.BAR (New version)
\WINDOWS\SYSTEM\FOO.BAR (Old version)

It seems that in scenarios 1) and 2) that the old version of FOO.DLL is loaded or no version is loaded and in scenarios 3) and 4) that either the old or new version is loaded. My question is what is the answer in each scenario?

:confused: bractals

goodcanuck
02-08-2002, 01:47 PM
my $0.02,

if you were getting an error message when you run FOO.exe - that it can't find a certain .dll then you may want to uninstall then reinstall or find the missing .dll and add it wherever the prog in question finds its .dll's.

You need bar.dll in the foo folder. or another .dll telling foo.exe where to find the bar.dll...easier to just put the dll in the prog folder...especially considering the amount of space a dll takes up.

melloman
02-08-2002, 03:06 PM
Mostly, Windows will look in the current folder where the .exe is, then go to c:\windows\system and c:\windows. Anything else can be added with a PATH statement added via autoexec.bat, or any other .bat's you'd like to load in your belfry....

bractals
02-08-2002, 07:00 PM
Hi melloman,

Thanks! I think you just answered my question.

:D bractals