First make sure whether you have a virus or not by running an antivirus program, if you don't have one download one. Free ones are available.
Microsoft Security Essentials > http://www.microsoft.com/security/products/mse.aspx
Formatting your drive will erase all data on that drive including the operating system. Do you have a instalation disk to reinstall Windows?