Got a fuller picture of the problem now.
If running on battery the laptop switches off after 10-15 mins even though the battery meter shows 80%. If switched back on it will run again for 10-15 mins. If it is plugged into the mains it will run forever. It is approximately two years old.