Finding process that locks a DLL

You want to replace a dll on a system, but you get access denied, although you’re admin, have the necessary rights.. so which process is locking the particular file/library. I know, there is handles.exe from Sysinternal Suite, and plenty other tools that do the trick.But, you don’t need third-party tools to get the answer, just use tasklist.exe or PowerShell.  

Windows command line:

C:\> tasklist /FI "modules eq vstoee.dll"

PowerShell

PS C:\> Get-Process | ? { $_.Modules -like "*(vstoee.dll)*" }

Leave a Reply

Your email address will not be published. Required fields are marked *