For Nokia:
*#7780# (custom reset)
*#7370# (Hard reset)
with sim card and battery should be charged only for WD2 and BB5 models
press *,3, calling key and on/off switch at once -only for WD2 model without sim +memory card but battery should be charged.
For Samsung:
*#2767*2878# (custom reset)
*#2767*3855# (hard reset)
with/without sim card but battery should be charged.
For L.G.
2946#*#
wiht/without sim card but battery should be charged.
If battery isnt fully chared then while formatting the set may be dead and you have to do software(flashing)