My Pc has been locking up frequently recently. I can make it lock up faster by running Windows Media Player on a file from hard disk. I am now trying to run the same file from a USB Key.

I was able to run memtest and it passed once. I know I should let it run for more than that, but I'll see about it when I have enough guaranteed electricity.

HDDScan didn't find any bad sectors, but there were some slow patches requiring in the scale of 500ms to access.

Advice?
Ok first of all, we're going to disable automatic restart on system failure. To do so, we have 2 methods:
Method 1 is for when the system is booting up. It is the easier option, use it if you've just started the system.
Method 2 is for when you're in Windows.

Method 1: Whie system is booting, and BIOS checks are being carried out (before Windows boots), Press F8 / F10 to bring up the advanced startup options. Select "Disable Automatic Restart on System Failure" and press Enter.

Method 2: Right click Computer, select Properties. Click on "Advanced System Settings", then click on the "Advanced" tab, then under "Startup and Recovery", click on "Settings". Under "System Failure", uncheck the box named "Automatically restart".

This would allow Windows to throw up a Blue Screen of Death (BSoD) so that we can further identify the issue.
Just to note, the PC is not automatically restarting. It just plain freezes. It doesn't even write anything to disk. The last time it did generate a dump was 17th December. Yesterday alone, I made it freeze three times.
What type of file are you running, btw? And did running the file from a USB flash drive work?
It's a normal mp4 file am downloading from channel9.msdn
It ran well from the key but I am still not 100% sure.
Today it crashed once again while using visual studio 2010. No media player in process list.
Your hard-drive might have a bad sector, or it may be that your PC is to obsolete to run the newest programs , what are your specs ?
Either of the following two apply;
1- your heat sinks or Cooling is failing
2- your mobo is dieing

I am excluding the option that the OS is corrupt, corrupt driver or such. This can occur with electric shortages
Guys, let's agree on something. Since such a problem can have multiple causes, we cannot, as of now, nail the exact cause without troubleshooting. So let's not say: this is bad, this is dying. Let's CHECK first.

@AvoK95: He has a Core i7 2600K, with its integrated graphics. It's not obsolete :P

As BashLogic suggested, maybe your cooling is the problem. Download SpeedFan, CPU-Z, GPU-Z, and CoreTemp, to monitor CPU, System, GPU, VRM, etc... temperatures. Enable "log to file" in GPU-Z.

Run Prime95, run "In-place Large FFTs", and monitor temperatures via CoreTemp. Let's get that out of the way first.
I tried Prime95 on all 4 cores (two threads) for about an hour but nothing happened.
Ill ask for more help on it soon
first check your hardware, open the lid see if there is anything damaged or any leaking capacitors, i don't think its the psu since prime 95 ran fine, its either the hdd or the motherboard

edit: in some extremely rare cases its the graphic card
Check out your memory and paging.

When it freezes can you still open other stuff? Like task manager? Or it totally freezes up? After it freezes, do you hear your HardDisk making a sound then stopping?
@Shant: open up PSU? He'd void his warranty.
@Badieh: he ran memtest86+ outside Windows, and it passed, so there don't seem to be any memory problems. However, maybe paging is the problem?

@arithma: maybe turning off paging will solve the problem? And you didn't check the Prime95 temperatures. Sometimes the CPU will crash at 0% load due to sudden voltage spikes going from one frequency / state to another. You might want to check BIOS settings for CPU voltage, RAM voltage, and Load-Line Calibration. Make sure LLC is OFF.
Prime95 couldn't raise CPU temperature above 70 degrees Celsius. I think the CPU and Memory are preliminarily excluded.
- Harddisk
- Corrupt Drivers/OS files from Electric Shortages
- Motherboard.

What do you usually do to test harddisks?
What about drivers, how can I check if they're valid or not?
Can I do anything about the motherboard?
arithma wroteWhat do you usually do to test harddisks?
Just run a scan disk , and keep your ears open to hear clicking or weird noises.
You can also try hooking your HDD to another PC via USB and check if it getting detected normally (If it's not that could mean that you might have a HDD board problem.)
If your HDD LED is always on on the case that could be a sign of HDD failure.
arithma wroteWhat about drivers, how can I check if they're valid or not?
This is not a driver problem , because it it was you would have experienced sudden restarts or BSOD's
arithma wroteCan I do anything about the motherboard?
If you passed a prime95 and memtest then it's a 90% sure that the motherboard has no problem

Your main problem could be:
-Lack of PSU Wattage/voltage/amperage
-You might have a loose cable connected

Hang up problems are usually hardware problems.
Till now I have never experienced any hang up problems that are caused by software.
I ran chkdsk and the following got spat out:
CHKDSK is verifying files (stage 1 of 3)...
  285440 file records processed.
File verification completed.
  205 large file records processed.
  0 bad file records processed.
  2 EA records processed.
  60 reparse records processed.
CHKDSK is verifying indexes (stage 2 of 3)...
  385260 index entries processed.
Index verification completed.
  0 unindexed files scanned.
  0 unindexed files recovered.
CHKDSK is verifying security descriptors (stage 3 of 3)...
  285440 file SDs/SIDs processed.
Security descriptor verification completed.
  49911 data files processed.
CHKDSK is verifying Usn Journal...
  36058008 USN bytes processed.
Usn Journal verification completed.
Windows has checked the file system and found no problems.

 181083135 KB total disk space.
 118664024 KB in 232606 files.
    120968 KB in 49912 indexes.
         0 KB in bad sectors.
    394307 KB in use by the system.
     65536 KB occupied by the log file.
  61903836 KB available on disk.

      4096 bytes in each allocation unit.
  45270783 total allocation units on disk.
  15475959 allocation units available on disk.
I don't see any serious thing there, plus it didn't hang at all. It was all very fast actually.
I guess I forgot to include my setup!
1 	Cooler Master Elite 335 ATX  w/ Enlight 450W PSU Black  	Operational Warranty 	$80.00 	$80.00 	
1 	Intel Core i7-2600k 3.4GHz 8MB Quad Core LGA-1155 Original Boxed  	35045647A1156TEN3 	$362.00 	$362.00 	
1 	Intel DH67CL w/VGA+Sound+SATA+Lan&PCI Express  	E069954682B7BEC29 	$113.00 	$113.00 	
2 	Kingston 4GB DDR3-1333 PC3-10600  	0V9JU/8WBEFTEN3 	$44.00 	$88.00 	
1 	WD 500GB WD5000AAKX 7200RPM S-ATAIII 16MB Internal HDD  	WCAWFD738894VC28 	$48.50 	$48.50 	
1 	LG GH24NS50-24X DVDRW - Dual Layer SATA  	003HUNR390727CHC29/4 	$26.50 	$26.50 	
1 	Microsoft Comfort Curve 2000 Keyboard Black USB (Limited Warranty) 	7691405701597GC7/8 	$20.00 	$20.00
I kept the prices just in the minute chance that you'd be interested.
Did you check the BIOS settings I told you about? As AvoK95 said, it is most probably a hardware problem.

@AvoK95: Drivers do not only cause BSODs or restarts, they can also cause hangs. Nvidia driver stops responding and the screen goes black then resumes normally, for instance.

@arithma: After you check the BIOS settings and make sure that they are alright, you could reinstall drivers cleanly. I recommend downloading Driver Sweeper from Guru3D, to thoroughly clean the system of any drivers. I suggest you reinstall the graphics driver first, then try the others.
Boot your PC in safe mode (Hold the F8 button during boot, then choose Safe Mode from the list). Then wait and see if your system freezes.
yasamoka wrote@AvoK95: Drivers do not only cause BSODs or restarts, they can also cause hangs. Nvidia driver stops responding and the screen goes black then resumes normally, for instance.
Yes it stops responding resulting a blank screen, but not a full hang of the system.
@MrClass: My PC needs about 4 hours to freeze. I am still trying to make it freeze on purpose, but seemingly the Windows Player trick is not working anymore.
My RAM voltage and timings are set correctly (according to the datasheet). (1.5V, 9-9-9 CAS)

Does anyone know his way around WinDbg? I tried to use it, but it got stomped (I think on downloading debug symbols from Microsoft). My latest memory dump was generated in 17 November. BTW, drivers that have deadlocks or infinite loops can cause the PC to freeze. A bad mouse driver can cause the whole PC to freeze.

How about this: SMART Report of the Hard disk
	Num 	Attribute Name 	Value 	Worst 	Raw(hex) 	Threshold

	001 	Raw Read Error Rate 	200 	200 	0000000000-0000 	051

	003 	Spin Up Time 	142 	141 	0000000000-0F33 	021

	004 	Start/Stop Count 	100 	100 	0000000000-0259 	000

	005 	Reallocation Sector Count 	200 	200 	0000000000-0000 	140

	007 	Seek Error Rate 	100 	253 	0000000000-0000 	000

	009 	Power-On Hours Count 	099 	099 	0000000000-0389 	000

	010 	Spin Retry Count 	100 	100 	0000000000-0000 	000

	011 	Recalibration Retries 	100 	100 	0000000000-0000 	000

	012 	Device Power Cycle Count 	100 	100 	0000000000-0257 	000

	192 	Emergency Retract Count 	200 	200 	0000000000-01B4 	000

	193 	Load/unload Cycle Count 	200 	200 	0000000000-00A4 	000

	194 	HDA Temperature 	119 	102 	24 C 	000

	196 	Reallocation Event Count 	200 	200 	0000000000-0000 	000

	197 	Current Pending Errors Count 	200 	200 	0000000000-0000 	000

	198 	Uncorrectable Errors Count 	200 	200 	0000000000-0000 	000

	199 	UltraDMA CRC Errors 	200 	200 	0000000000-0000 	000

	200 	Multi Zone Error Rate 	200 	200 	0000000000-0000 	000