Windows – tell Windows 10 – ‘If I close the lid on the laptop, go to sleep IF I don’t have an external monitor attached’

laptopmultiple-monitorspower-managementsleepwindows 10

I am aware of the following SuperUser questions:

Neither of these have useful answers, and are also both quite old.

In the current version of Windows 10, is there a way to tell Windows to sleep only if the lid is closed and there are no external monitors attached?

In work, I like to close the lid and attach a couple of monitors, at home I just use the laptop as-is.

Sometimes I close the lid before I leave for home, forgetting it's actually still running, and take my laptop out of the bag when I get home to discover it is radioactive hot!

The laptop is a Dell XPS 9550, if that helps.

Thanks

Best Answer

That functionality is not built into Windows.

However, it would be fairly easy to write a script to do so. In Poweshell you would use Get-WmiObject win32_desktopmonitor to see if a monitor is attached, then you can change the power plan accordingly.