A locked file can usually be removed by holding the Option key down when you choose to empty the trash. A locked item in the trash should not prevent other items from being emptied.
Just tried it. Keep getting the message. What am I doing wrong?? I go to the trash and select empty trash, and the messge pops up for many files (I am trying to delete a microsoft proram and it is the source of these locked files...)
Most likely this happens when the file is not COMPLETELY locked, but partially. Solving this is done by making the file locked (eventually afterwards making it unlocked). How to do so, see the reply of onslaught. Unlocking is not necessary, locking it in general oke (when using command empty trash).
Thanks for all the ideas. I had >200 files in the trash, so couldn't tell which one(s) cotained the "problem(s)", so I put all the trash files into a new folder in the desktop and then performed the operation via the terminal application-- Worked like a charm!