Hi there and welcome
A faulting battery can cause this but there can also be other causes.
First, which version of windows is it running? And how long can it stay on for?
Can you return to your question here please?
ok, click start, right click computer and select properties.
On the window that opens, go to the bottom and tell me what it says about windows, if it is activated please.