There are a couple of ways of doing it being tftp and xmodem. Ill talk you through the tftp part first.
Install a tftp server on your PC if you are on Windows then try: ftp://ftp.3com.com/pub/utilbin/win32/3CTftpSvc.zip
Otherwise Linux has got tftp server also.
You will need to connect router B to the network and give it a IP address:
int fastethernet 0 ip address xxx.xxx.xxx.xxx [subnet_mask]
Once you have TFTP running on PC then on Router A you can do:
copy start tftp://TFTP_server_IP/router_A_config You will see a successful copy if everything is set up correctly.
Then on Router B make sure you have connectivity with TFTP server by pinging it. If you get a response then do:
copy tftp://TFTP_server_IP/router_A_config start. It will tell you that the config has been copied.
Remove router A from the network and connect Router B in place and reload the router. As long as the routers are identical then you should not have any problems.
What software are you using to connect to the console on Router B. On Windows in hyperterminal you can do a xmodem transfer, you will see the options in the menu but you must first copy Router A config to the PC connected to Router B.
Hope this makes sense.