The reason I asked about if it happens close to boot as there is away to delay the check. Your problem looks like it is more than that.
What version of avast are you using, the current one is 4.7.942 (see about avast) ?
I think the 0x00000002 is “The system cannot find the file specified.” Try a repair of avast. Add
Remove programs, select ‘avast! Anti-Virus,’ click the Change/Remove button and scroll down to Repair, click next and follow. You need to be on-line to do this.
If that doesn’t work try, uninstall, reboot, install, reboot.
It would probably be best to download the latest version of avast and save it to your HDD, somewhere you can find it again. Use that when you reinstall.