Is there a way to get the SearchPath API to not search in c:\windows when using the default search path (passing NULL as the first param)? I can’t modify the caller to send in a specific path.
I have a system with an application ini file in c:\windows (which I don’t want it to use, but for legacy reasons has to remain there). I put my copy of the same ini file in c:\users\public, and put c:\users\public at the front of my system path environment variable, but a call to SearchPath still finds the c:\windows version. If I delete that version, it then finds the c:\users\public version, so I know the path was set correctly.
According to MSDN, there’s nothing you can do about this bar changing a system level (HKLM) registry entry (Which is a ‘bad thing’). The registry change would cause the search order to start with the current working directory, which you could set to the desired folder in a shortcut. (Again, I’m going to say; changing a Machine Level registry entry to do this – is potentially dangerous!)
Have you looked into application shims? This may be something that could work for you.