Is this a store bought computer, HP, Dell or other. They usually have their Recovery on a partition. At the beginning of start up at the bottom right of the screen, it usually says hit (f10) or some other (F) key to restore back to factory defaults.
And to upgrade to Windows 7 you have to buy the program and do a full install, this will take care of formatting (erase the hard drive). But, these other people need more information to help you out a lot better. Make and model of computer in question. What the error message says. And what not, more information, more help you will get.