This is done through the power management settings. Are you putting your computer to sleep or letting it happen automatically. Have you tried using hibernate?
If it does not show that option this is how to fix it.
Re-enable hibernate in Windows 10:
1. Right-click on the Start button and choose Command Prompt (Admin) from the pop-up menu. If you are prompted by the User Account Control asking if you want to allow this program to make changes to your computer, click Yes to proceed.
2. In the Command Prompt window, type powercfg.exe /hibernate off and press the Enter key. Exit the Command Prompt window.
3. To enable hibernate in Windows 10, open the Command Prompt again and type powercfg.exe /hibernate on and press the Enter key.