HP Pavilion DV7 Shut Down Unexpectedly

Solution
No fix for a bad hard drive - - it must be replaced.

However, for confirmation that the hard drive really is faulty you should test it with drive manufacturer's diagnostic software such as SeaTools for DOS: http://www.seagate.com/gb/en/support/internal-hard-drives/consumer-electronics/ld25-series/seatools-dos-master/

Or, a slightly easier option which doesn't require the making of a boot disc, you could install the drive as storage on another PC and test it with SeaTools for Windows: http://www.seagate.com/gb/en/support/downloads/item/seatools-win-master/
No fix for a bad hard drive - - it must be replaced.

However, for confirmation that the hard drive really is faulty you should test it with drive manufacturer's diagnostic software such as SeaTools for DOS: http://www.seagate.com/gb/en/support/internal-hard-drives/consumer-electronics/ld25-series/seatools-dos-master/

Or, a slightly easier option which doesn't require the making of a boot disc, you could install the drive as storage on another PC and test it with SeaTools for Windows: http://www.seagate.com/gb/en/support/downloads/item/seatools-win-master/
 
Solution
Hi there pranaman,

Can you power the laptop right after it shuts off? In case you can't and need to wait for a while, you could be dealing with an overheating issue.

As for the drive, I would agree with Phillip Corcoran. You can use some HDD testing tool for DOS mode. If you have some data stored over there, you may need to use some data recovery tool for DOS mode as well. (or you can back up your data if the laptop works fine for a while)

Cheers,
D_Know_WD :)