Firstly I would like to explain differences between Viruses, Trojans and Malware.
Malware - is the short form of Malicious Software. It is basically a software written to cause damage or infiltrate computer systems without the owner informed consent. It is general term used to represent various forms of intrusive, hostile and annoying code.
Virus - is a software that copies itself and spreads without permission or knowledge of the owner. Viruses do not spread via exploiting vulnerabilities (the ones that do that are called Worms). The only way viruses are supposed to spread is with the host - at least in their rigorous classification. Let say that a virus has infected a file, now if the owner moves the file to any system, the virus has thus chance to spread and survive.
Viruses can be classified into the following sub-categories:
- Resident type: which one executed becomes memory resident(and waits
for some triggers such loading of other program). It the infects
other programs and so on.
- No resident type: once a virus is executed, it will search for files it can infect.Then after infecting them, it will quit. When the infected program is run again, it will again find new targets and so on.
- Boot sector, which spreads via boot sector and Multi partite type with several types of infection mechanisms.
Trojan - is a kind of malware that appears to the user to perform a function but in fact facilitates unauthorized access to the system. Moreover, they are quite different from viruses. They are not self replicating unlike viruses.
So in general a virus cannot execute itself, unless it has the cooperation of the operating system or software bugs or the user intervention.
If the operating system allows files to be executed automatically because of their name or location (for example an email attachment) then a virus can masquerade as a legitimate file and be executed by the operating system without the user authorization. This used to be the default behaviour in early email clients.
Also, if the operating system is not patched or specific software has errors that a virus can exploit to run its code, then a virus can start itself.
So to answer your question: Yes you can infect your machine by downloading and storing malware on your hard drive without executing.