Set Screen Saver Timeout

Supply the timeout as an integer value to set the Screen Saver Timeout interval.

Script

<#
.SYNOPSIS
This script can be used to set the Screen Saver Timeout interval.
.DESCRIPTION
This script can be used to set the Screen Saver Timeout interval.
.EXAMPLE
C:\PS> C:\Script\Set_Screen_Saver_Timeout.ps1 100
Sets the ScreenSaverTimeOut value as 100.
#>

Param([int]$value)
$path = ‘HKCU:\Control Panel\Desktop’
$name = ‘ScreenSaveTimeOut’
#To get the ScreenSaveTimeOut value.

$old_value=(Get-ItemProperty -path $path -name $name).$name
echo “Old ScreenSaveTimeout: $old_value”
#To set the new ScreenSaveTimeOut value.

Set-ItemProperty -Path $path -name $name -value $value
#To get the new ScreenSaveTimeOut value.

$new_value=(Get-ItemProperty -path $path -name $name).$name
echo “New ScreenSaveTimeout: $new_value”

 

Output
Screen

Leave a Reply