You might be getting the error, “The process cannot access the file because it is being used by another process”because Opportunistic locking is not enabled.
You may enable the same from registry editor.
Important: This post contains information about how to modify the registry. Make sure that you back up the registry before you modify it. Make sure that you know how to restore the registry if
a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base: