Depend on the virus.
- Some modify the boot record so that when you start your computer, you will be booting into the virus code instead of into your operating software.
- Some hide in the keyboard key input routine. These usually record key strokes and keep them until they are requested by the author of the virus. This is a common way of stealing credit card numbers.
- Some attach themselves to application programs by modifying .exe or .dll files and then do their work when the program is run.
- And there are many more