So I took Computer 1 to a computer shop. The staff there set it up, and it ran fine for a few hours. They opened the case and said they couldn't find anything wrong with it. I took it back home, reconnected everything but it shuts off randomly again.
Things I've done to solve this problem:
- system restored to three days back (this started happening last night)
- ran AVG anti-virus in safe mode (took a few tries since it still shuts down in safe mode)
- ran lavasoft ad-aware in safe mode
- changed the power connections so that Computer 1 uses the power outlet that Computer 2 uses. Computer 1 still has the same problem. But Computer 2 can use Computer 1's outlet perfectly fine
- changed the power connector so that Computer 1 uses the black power wire that Computer 2 uses. Computer 1 still has the same problem. But Computer 2 can use Computer 1's black power wire just fine