This doesn't sound like a software fault but more of a hardware fault - predominantly the battery and charging circuit.
As with all rechargeable batteries laptop ones get to become useless after x amount of charges.
have you tried replacing the battery?
What happens if you run the PC on the AC power? Does it stay on or not?