Laptop computer turning itself off

I have a Compaq Presario laptop (less than a year old) that at random times, just totally turns off.  No warning.  This happens both when it is plugged in and when it is operating on battery power.  It usually doesn't happen until it has been on for a least an hour or so, sometimes longer.  Any clues where to look for what might be wrong?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What Operating System? Have you been monitoring the heat to see if that may be the cause?
clballasAuthor Commented:
I am using Windows XP.  No, I haven't been monitoring the heat - how do you do that?
Usually you can tell its a heat problem if when it shuts itself off...then you can't turn it back on for 10 minutes or more.  If you can turn it on right away after it shuts itself off and it actually stays on for a while not just a couple minutes then its *probably not a heat issue.  If it is....check to see if the fan usually in the back, sometimes on the bottom is spinning at anytime.  Laptops fans don't spin all the time usually only when needed to conserve power.  Putting heatsink compound on the cpu may help.  Though these two solutions require you to pull the laptop apart which can be a little overwhelming for some people, cause of all the small parts and little screws that tend to jump off the table and play hide and seek.  You say it does it when its plugged in and on battery have you pulled the battery out and just used ac power?  Bios update may be in then just follow the links.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Well, one reason may be the heat. However, have you ever noticed what it says when it is shutting off or does it just go off without warning? Does it turn off, or does it hibernate? When you start up the computer, does it display a notice like" Windows has just recovered from an internal error" or the like? Usually you should get that button if you did not mean to turn it off, and you turn it back on. Try running Anti Virus programs or Scan Disk, or defragmenting you drive. Hope this helps =)
See if you can get an error message

Right-click My Computer, click Properties, click the Advanced tab, and then click Settings under Startup and Recovery and uncheck Automatically Reboot.

also memeory dump file may have been created

How to Gather Information After a Memory Dump in Windows XP;en-us;314084

Download Pstat here
Pstat.exe: Process and Thread Status 
clballasAuthor Commented:

"have you ever noticed what it says when it is shutting off or does it just go off without warning?"   no warning

"Does it turn off, or does it hibernate?" just turns totally off

"When you start up the computer, does it display a notice like" Windows has just recovered from an internal error" or the like?" No, nothing at all

"Try running Anti Virus programs or Scan Disk, or defragmenting you drive"  thanks for the suggestions, I will try

Roy SidebottomIT TechnicianCommented:
have you checked the power options setting in your control panel? it may be that the power schemes are set to something ridiculous like 'turn off hard disk after 5 minutes', also check the hibernate option within their as well.
it is prolly your power settings, ntoebooks have default settings to save power by turning off hdd n monitor n so forth, go to power options and set always on :D or select never for EVERYTHING :D. disable hibernation though, it sucks :D
Ususally, if a computer turns itself off w/ no warning, in my experiance it's always been because of overheating.  Try running it in a cold area, with a fan on it, or even on an old thing of leftovers that's been in the fridge(prefferably not directly on food, more like a cold tupperware box; inprovise).  It's a ghetto way of testing the theory, but laptops tend to be natorious heaters, and that sounds like your problem...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.