A computer virus can't harm computer hardware because it is only code. However, it may result in situations where computer-controlled hardware or other equipment is harmed. For instance, a virus can tell your computer to disable the cooling fans, which would lead to overheating and hardware damage.