Hi,
1. Are you trying to re-install Windows XP or Windows 7?
2. Did the computer come with a recovery disc?
3. Why are you trying to format the hard drive?
4. What is the exact issue that you are facing?
You will need a Windows installation disc to format the hard drive and install a fresh copy of Windows.
Please reply to the questions, so that we can assist you better.
Also, you need to contact the computer manufacturer for assistance related to performing a factory restore.