The virus you are talking about was probably in use when you tried to remove it. Try running the Avast Anti-virus console and right click it. Select "Schedule boot time scan" and restart. Avast should run before allowing anything else to, thus making it possible to delete, or repair the infected file.
if this doesn't work download the virus removal tool from the avast mainpage and use it.