You mentioned that this would happen even if it's connected directly to the AC adapter but without the battery right?
- If it's shutting down by itself while it's just connected to it's AC adapter and without the battery the problem may lie on the AC adapter itself.
- Try to test you AC adapter using a multi tester if it's supplying enough voltage to your laptop.
- If it will still shut down put the battery back in and the AC adapter and observe if it will still shut down.
- If it will not that means it's the AC adapter that is faulty.