My Macbook pro keeps shutting down right after I log in. The power cord seems to be fine, so I think the computer has enough power. Right after logging in, it shows a grey background with a loading bar that loads only 1/4. Then it shuts down.
I have had my Macbook Pro since 2011 and it has been great until now. Suddenly, I can no longer get past the grey screen just after I log in. The grey screen appears with a loading bar, and the bar get 1/4 of the way complete, then the computer shuts off. My power cord seems to be working fine because this problem still occurred after using another power cord (from another Macbook). Keyboard does not light up, and the small green lights on the left side of the computer do not light up (this is an older version and these light indicate how charged the computer is). It is using the OS X Yosemite and recently had total clearing of the hard drive as it was transferring from one owner to another, so the hard drive isn't nearly full enough to be causing this problem. I've never run into this problem before with other Macbooks.
Help!
MacBook Pro, Mac OS X (10.6.8)