executable file is locked for approx. 1 minute or more when deleting it by System
The root cause was found by one of my team members called Vadim Blumkin
Apparently when the service Application Experience Service (aelookupsvc) is disabled there is a weird behavior in windows 2008 R2 / Windows 7 that causes executables to be locked when trying to delete them
Amazingly this is a known issues that is listed here
We founds this issue while our process copied an exe , ran it and than tried to delete, copy and run again – we got access denied because files is being used. the handle was locked by System process
according to Microsoft this service is not required but I would advise you to leave it as is and NOT disable it.