Chosen Solution

When I plug in my computer the computer works and shows that it’s charging but when I disconnect the charging cable the computer turns off.

Your battery may be failing or losing the ability to hold a charge. Try replacing the battery. Also, refer to the troubleshooting page for further help.