I'm writing something to automate a software release to 800 servers. The current process is very manual. Most of the automation is quite simple, but one of the requirements, is that before the release takes place, any files that are in use from the folder must be freed up. In order to do this, I need to find any running processes that originate from the folder (fairly simple), but I also need to find any processes (located anywhere on the server) that are using DLLs from the folder, as there may be other programs on the machine that are using DLLs from my target folder.
Any ideas on how I can get a list of DLLs in use by processes, and then check their path?