System powers off [SOLVED?]

Ive just replaced my mobo, cpu, and memory. MSI z370-a pro, i5-8600k, and two 8gb ddr4 sticks.

First when I put everything together everything was running smooth. But after a couple of hours the system switched off. Not powered down, just instant power off, almost like a safety feature.

Then it did it again after 30 minutes or so.

Then it started doing it after 30 secs of being on or so.

I installed Afterburner, and the CPU or GPU are not heating up at all. I am not doing anything demanding on the system when it turns off.

I fiddled around in the case, redoing connections (not very systematically), and i managed to make the system stay on for a bit longer, 10-20 minutes this time. Then after a while, power off again, and again it started turning off within 30 seconds of logging into windows.

So power stays on fine while Im in BIOS. Once the system starts and windows loads, its lights out.

Now, I fiddled around in the case again, this time I removed the big power connector on the motherboard, reconnected it, and the system has stayed on long enough for me to write this post.

So I feel like this issue has to have something to do with the physical connections in my case, right ?

Could any BIOS settings cause something like this? And why would fiddling around the case make such a huge difference if it was a settings problem?

Im very new as a system builder so talk to me like I know nothing, dont assume I’ve done anything right.

Last night when the system was powering off immediately after win loading up, I took out the other memory ram, that made no difference. Then I swapped the remaining one to the place of the other ram, made no difference. Then I put them both back in, no difference.

So, I’m thinking the memory and the ram connections should not be an issue.

Also, last night when the problem was at it’s worst, i fiddled around with the SSD connectors, and after restarting, there was a huge difference. This morning however, i did not touch the SSD connectors and made a big improvement by reconnecting the mobo power connector.

I am at a complete loss here.

I’m going to try to gently tap connectors one at a time while the system is switched on, and see what happens.

Tapping connectors did not switch off system. Gently pulling on them didnt either.

And now 20 minutes later the power went out again, and its now doing it immediately after windows starts again…

Got a “new” PSU from a friend and installed it. System has been running for 4 hours straight now. Feeling optimistic.