If it's a laptop and you have an ageing battery this will cause the problem you describe, even if you have your laptop plugged in......Try removing the battery entirely restart the laptop with just the A/C adapter connected.....
See if that cures it.......
Good luck..