I have a HP nc6000 laptop. Without the battery, it works perfectly, but with the battery connected it hangs after a while.
What might be the problem, and how could I fix it?
After testing the battery's voltage as admintech suggested, if the voltage is fine, all you can really do is test with a new battery and hope that it is not something worse. At that point it could still be the battery, but if it is the motherboard, it will not be worth repairing.
Given the age of the computer (based on the Pentium M 1.6 processor some have), it is probably just that the battery has hit the end of its life.
maybe try taking a voltage reading with a multimeter? and see if the battery is working, if not you may need a replacement