Hi!
I understand when you unplug the adapter from your laptop the laptop shuts down.
Don't worry I'll to help you out.
Did you make any software or hardware changes on your laptop?
Have you tried checking with a different adapter or battery?
Please provide the product number of your laptop to assist you better.
As you mentioned when you unplug the adapter from your laptop the laptop shuts down.
Try updating the BIOS on your PC and check if it helps.
You can update the drivers using HP support assistant.
Refer this article to know more information about using HP support assistant.
Please perform below-shown steps to resolve the issue:
Step 01. Click on the Start Button
Step 02. Type "Device Manager" in the start search box & open the Device Manager
Step 03. Look for Batteries and expand it by click on the + symbol on the left
Step 04. Right Click on "Microsoft ACPI Compliant Control Method Battery" & uninstall
Note: This Battery driver will get reinstalled automatically when you restart the Notebook again
Step 05. Please Shutdown the Notebook
Step 06. Please remove the Battery and unplug the Power Adapter
Step 07. Press and Hold the Power Button for full 1 Minute
Step 08. Go ahead and put back the Battery and connect the Power Adapter
Step 09. Look for "Plugged In Charging" message on the Battery icon
If the issue persists try updating other drivers on your PC using HP support assistant.
Also, Try running a battery test on your PC using HP support assistant and check if the battery is functioning correctly.
Refer this article to know more information about using HP support assistant.
If the solution provided worked for you, please mark accepted solution for this post.
Let me know how it goes!
Take Care!
Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!