Er, what do you mean by opening and closing by itself? Programs or the casing or what ._. Or do you mean it keeps auto restarting?
Yeah sorry i wasnt clear. My computer keeps auto restarting and nope :\ i didnt download anything suspicious. In fact, i didnt download anything on that computer since months probably.
Few possibilities. 1) Graphics card/drivers causing the problem. 2) Virus. Remembered there was a virus from a few years back that does the exact same thing, keeps causing your system to reboot.
Maybe your computers overheating? I used to have that problem before, what I did was open up my pc and hoover all the dust and stuff which have clogged up the pc. Worked like a charm.
This happened to me once it was a really simple answer. The power cable was loose at the back. Its like a 1% chance of being ur problem but try anyway!
I had that issue with my laptop it was caused by overheating and maybe you need a can of compressed air and clean out the dirty ol' dust XD
It could be that your graphics card is overheating. Also have you run windows update lately? Sometimes the updates can be buggy.
Open up your cpu and make sure that all your cards and rams are in place properly. It could be the fact that some things are loose inside, causing it to keep autorestarting.
Be more specific. When exactly does it shutdown and restart? Does it do it as soon as you turn on your computer or a while after using it?