Power adapter has not been charging the battery

I have a Toshiba Satellite P35-6292. Recently the power adapter has not been charging the battery when the computer is powered on. It will charge it when it is off though. Strangely when I turn on the computer the battery light will go off (indicating in Toshibas that the system is running on battery power only) while the AC power light will remain on. After windows boots up completely the icon signifies it charging for a brief 5 seconds and then reverts back to battery power only. The computer will boot normally with just the battery in. However, when I try just AC adapter with no battery in, the laptop will boot up until the black screen right before the Windows logo normally shows up. Then it will shut off completely. Also note that with just the AC power in I can actually leave the computer on indefinitely with no battery only while I’m in the systems bios. As soon as I try to start windows it will shut off before the logo. I have also tried another Toshiba power adapter but not a different battery. It almost seems like windows is involved with the problem. Any ideas?

Will it make any difference if you boot the laptop into safe mode? May be Windows power management software is screwed up.
Here’s another test. You can boot the laptop from a live Linux CD. I usually use Knoppix CD. If you start the laptop from this CD, it will boot into a Windows-like environment. It loads Linux OS directly from the CD bypassing the hard drive. It’s a good test to find out if you have a software related problem. If the laptop still switches to the battery with the AC adapter plugged, then it’s not software related problem.
You can also reinstall the operating system form the recovery DVD, it will eliminate any software related issues too.
Make sure you the laptop has the latest version of BIOS. Upgrade the BIOS if needed.
The problem also could be related to the power jack.