The powercfg utility can be used on the command line to change power configuration settings, including the monitor timeout, which is what we’ll use here.

The command syntax:

This will change the monitor setting to stay on for 120 minutes while on AC power. You can use -dc at the end to change the setting for when you are on battery power.