Lost the code ?? -- Is the System a prebuilt or self assembled unit ? (normally the code is on the label attached to your system case so you do not lose it) Do you still have the original installation CD ? If it is an OEM prebuilt system contact the maker they can verify the serial # of the system and will give you info on how to obtain a new code or if self build call Microsoft support and explain the situation (have any purchase info you can find and the original CD ready)- they will verify the disk ( from the writing and codes written on the CD ) and usually will give you a new code.
If neither of those works then you will need to buy a new copy or buy a copy WIN 7 and install them using their code or risk losing use of the OS after the time period expires for authenticating the OS.