problem seems to be fixed you are a genius thank you very much.do you know how i got these infections when i was using avast and also how do i stop my computer from getting infected again
Ha ha ha... no, I'm no genius.
Please do the scan I advised in the post above and post the log, we'll have to do some cleaning up for sure.
To your question: even if you use Avast (or any other AV btw) you will never be 100% protected. Malware authors are very quick in slightly altering their crap - so every AV has it's moments of vulnerability.
To avoid infection: use your brains when surfing. Don't click on buttons, links or ads that are promising something too tempting to believe or to be true. Do not open unasked for attachements in your emails just like this - make sure that the sender really knew what he was sending, even if it was a known friend.
Also p2p file exchange is a great source of malware (Bearshare, Limewire and the like), not to mention sites that "offer" cracks, hacks and porn.
You can increase protection if you are willing to invest $ 24,95 for a lifetime licence of
MBAM Pro. Unlike MBAM free, the Pro version will be a resident scanner when you start the PC and protect you from lots of stuff that may get by Avast.
Also it is always a good decision to have one windows user account with admin rights (only to use when software must be installed or anything else needs to be done that requires admin rights) and to have all other user accounts as "restricted" and do all daily stuff with this restricted account. This enables working / surfing / playing, but it prevents malware that is caught on this particular account to tamper with the system.