Things you can try:
- Check BIOS power settings and battery and if a BIOS update is available
- Update all drivers (for display see the card manufacturer website)
- Turn off hibernation
- Prevent devices from waking your computer. You can list all of them via this command line:
powercfg -devicequery wake_armed
- Turn off wake-on-lan
- Disable taskbar auto-hide
- Run
powercfg -energy
to diagnose power problems
For more advanced diagnosis tools, see the article Diagnose Shutdown Problems with Xbootmgr. With xbootmgr you could probably trace the source of your system shutdown issue.