In order to reset a router's password you must use password on it first. You can apply enable mode password or secret mode password.
Once password has been set save the configuration
and follow the specific process. i.e
1.Intrrupt the booting process of router an dgo to the rommon mode by command Ctrl+C. To intrrupt the booting you can manually reboot the router.
2. Tell the router not to copy the start-up configuration into the running configuration. To do this change the default configuration from 0x2102 to 0x2142 by running command Confreg 0x2142 in romman mode.
3. Reload the router again by running command reset .
4. Enter into enable mode without entering password. you wont be ask for password this time.
5. Now you need to copy the start-up configuration copy start run .
6. Remove the password in configuration terminal mode. # no enable password or #no enable secret
7. Again save your configuration #Copy run start.
8. Change registry to its default in Configuration Terminal mode. config-register 0x2102
9. Password Resetting Completed.