Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set monitor timeout to "never" using powershell

I want to write a script that will change the power settings for "turn off the display" and "put the computer to sleep" to "never" (see attached screenshot). I know how to set times for the above using:

powercfg -change -monitor-timeout-ac [time]
powercfg -change -monitor-timeout-dc [time]
powercfg -change -standby-timeout-ac [time]
powercfg -change -standby-timeout-dc [time]

but I can't find how to set it to "never".

what is the syntax I need to use?

thank you!

like image 658
shayelk Avatar asked Mar 28 '16 13:03

shayelk


1 Answers

Try this:

powercfg -change -monitor-timeout-ac 0

Per this, my favorite reference for missing help switch/parameter information: http://ss64.com/nt/powercfg.html

Setting any value to 0 will set the timeout=Never

Thanks to Cristian, official documentation with additional parameters is currently available here

like image 78
gravity Avatar answered Oct 13 '22 01:10

gravity