Reformat computer without a CD

Two friends of mine have had problems with their computers one has an emachine and the other a Toshiba neither one of them created install CDs but they both have Windows codes I believe both are running Windows 7. How can I reformat the computers with the CDs?
