Computer viruses have come a long way since their first appearance in the 1970's. As pieces of programming code, they're written to perform a specific function. Viruses can spread through email attachments, application programs on your computer, or application programs installed from disk drives.
In order to spread through a computer system, or network, a virus must be activated; meaning, the file that contains the virus must be opened, or executed in order for the virus to come to life. Once activated, viruses look for certain programs to infect, depending on what they've been programmed to do. The one thing that all viruses seem to do well is duplicate themselves within the programs they find, and that is how they spread.