How do I unprotect protected files (Win 7)?

I’ve been having issues with my Avast! antivirus software, and I’ve had it, it must go. However, the canned uninstall routine chokes, saying there is a corrupt file and the uninstall procedure won’t run. I tried to manually delete the directory, but the files won’t delete because they are protected, despite my ability to make myself an administrator.

How do I manually delete the Avast directory? I understand that I will also have to clean the registry afterwards, and I don’t have a problem with that.

Run services.msc and stop any services with Avast in the name. Also go into Task Manager and kill any Avast processes.

Take ownership of the folder, along with all subfolders and files, then grant yourself Full Control.

You might have to do this in Safe Mode if all else fails.