Thanks you all for your quick response.
I'll try your suggestions when the problem arise again.
I'm particularly curious about knowing which program is locking a file so thanks jcgriff2 for your help.
By the way, this problem could be solved just giving the user (at least if it have administrator privileges) the ability to unlock the file "ejecting" all the other processes which are locking the file. So instead of just saying "Not possible to delete because is locked", Windows7 could say "Some program is locking, do you want to fully unlock the file and proceed deleting ?".
I guess it is easier to say it than to do it but I'm suprised the Microsoft Team is not focussed on solving this issues.
Anyway thanks again,