If the CPU fan is reving to full speed a few minutes before it shuts down, what do you think that is telling you? It is telling you your CPU is getting too hot. Your CPU fan should not run at full speed unless you are overclocking, or for some reason the CPU is getting too hot. Start checking for heat related problems. Are your case fans working? Is your PSU fan working? Are your fans and heatsink full of dust, etc.