You can prevent your hard drive from virus by installing an antivirus. A good licensed antivirus helps to protect your data from any malware and adware attacks.