Recently I encountered this problem when trying to empty my Trash folder — the process kept being interrupted by an error message: “The operation cannot be completed because the item “wmphelp.htm” is locked”.
I hit the Continue button and there were similar messages: “WMPIcon.gif” is locked… “windowshade.gif” is locked…
Here’s a sample screenshot (from Otterman):
Clearly the problem were with files related to Windows Media Player I deleted earlier. I had about 300 over files in the Trash folder so I needed to find a solution quickly.
I emailed the folks in the me@n list (thanks folks!). Their suggestions included:
- Repairing the file permissions with Disk Utility before attempting the Empty Trash operation.
- Manually checking the offending file to ensure that I had Read/ Write permission
- Press Option + Empty Trash
Tried suggestion #1 (even booting from a startup disk and running Disk Utility from the CD) but still had the error message.
Tried suggestion #2 but problem was those specific file names weren’t in the Trash folder.
Suggestion #3 didn’t work either.
In the end, Siva aka Otterman provided the solution. He suggested “Cmd +Option + Shift + Backspace”.
It worked beautifully!
Even scared me a little ‘cos there was no prompt to confirm the Empty Trash operation. Hit those combinations and it cleaned out everything in the Trash folder immediately.
I’m still not quite sure why the offending file couldn’t be deleted (even though I had permission to delete it). But at least now I’ve picked up this neat trick with the keyboard shortcut.
Siva has more details about deleting locked files in OS X at this post. Excerpt:
- cmd-Backspace = move selected item to trash
- cmd-shift-Backspace = empty trash (with warning prompt; locked files not deleted)
- cmd-option-shift-Backspace = empties trash without dialog, included locked files