The following is the tutorial on how to retrieve lost or forgotten password in Windows XP. I'm not sure whether the commands used will work on any other Windows platforms, but it does in Windows XP.
1. Bofore restarting your computer and pressing F8 to get into Windows with "safe mode" environment, make sure you jot down all the information here.
2. You will notice there's Administrator account appears on the user menu. Logon to Windows through the administrator account. It won't request you for a password.
3. Go to Start menu and click on "run.." (Start>Run..) and type CMD.
4. At command prompt type in cd C:\Windows\System32 (assuming C is your drive where all Windows and system files reside).
5. Make a backup of your Logon.Scr file for safety purpose by typing in copy logon.scr Logon.bak.
6. After that type copy CMD.EXE logon.scr and choose Yes.
7. Finally type this following command to reset the password, net user administrator YourNewPass (assuming YourNewPass is your new password you want to change it to)
8. Restart your computer and logon with your new password.