Q:

DLL Search Path only partially searched

I just set up a new faster computer to be my development station.   I'm having a problem with a DLL not begin found when I run an application I'm working on using Delphi 6 Pro, but I don't think the problem is with Delphi.   Keep in mind, I have the exact same setup as far as directories and tools on my old computer and on that computer the DLL is found at runtime without fail.   The symptom appears to be that only some of the directories in my PATH environment variable are being searched, and the ones added most recently are not.   I have tried putting the diretory that contains the missing DLL in the current user PATH and then in the system PATH and the DLL still can not be found. 
Here are some facts:

The correct path for the DLL does appear in the PATH environment variable if I run a Command Window and query the PATH. 
If I put the DLL in a directory like the the Windows main directory it is found at runtime. 
If I use the Unix style "whereis" utilty form flounder.com it does find the DLL in the PATH
I monitored the program at runtime with (was SysInternals now Microsoft's) Process Monitor utility so I could watch the system searching for the DLL.   The system did search 7 out of the 10 sub-directories in the path but for some reason, as I said above, ignored 3 of them.   Note, I know invalid directories are stripped from the path but I triple-checked and they are indeed valid directories. 
Finally I created a C:\DUMMY directory and added that directory to the PATH environment variable and when I checked Process Monitor, that directory too was never searched. 

This is really strange behavior that I've never seen before.  It's as if there's a ghost copy of the old PATH before certain modifications were made to it that the system is using when searching for DLLs.  
Does anybody have a solution or diagnostic ideas? 
Thanks. 

A:

Be sure you are changing the system PATH variable (using the Control Panel), and that you are then launching any process completely from fresh.  If you were to run Delphi, change the path, then run the app in the debugger, then the new path will not be seen because it will inherit the PATH from the launching process, which still has the old one.  You should restart Delphi to get it to see the new path.