Chosen Solution

My late 2011 unibody MacBook keeps shutting down almost immediately after the chime. I have tried resetting SMC, NVRAM/PRAM nothing works. But I noticed if I disconnect the battery connector and reconnect, my macbook boots and stays on for like 30mins and occasionally for like 5hours. My battery is also not charging, the magsafe adapter stays green and shows no battery available when it boots. I suspect by battery is bad, but don’t understand why the MacBook keeps shutting down. Someone please help.

It sounds like you have multiple problems here ;-{ Did you have a liquid spill at some point? As the systems battery charge circuitry is not working properly and if the system can’t even see the battery SMC is also damaged. Which leads me to believe this is the case.