I have found that this is most likely a File System / WMI error (most likely caused by a fault in WMI service and / or permission restoring when uninstalling security software). Your best bet in solving this problem (on XP, Vista or Win7) is to repair Windows. You can either 'over-install' Windows on top of your existing installation (this keeps all your personal settings and files intact but may have you re-install some third party programs after the 'over-install') or you can search the web for a repair tool. One that I have used for years is from hxxp://www.tweaking.com and is called Windows Repair (All-in-One). There is no voodoo or mystery programs run by this tool; it is just a tool that runs Windows CMD commands for the repairs you want done.
One note is to download this program first, then download aswClear, disconnect from the internet and remove Avast (via Uninstall and then running aswClear in Safe Mode). After Avast is removed, run the repairs you want (follow the steps), reboot twice and then install Avast & connect to the internet.