[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3721
  • Last Modified:

Disable screen saver with Powershell

Is there a way turn off my Windows 7 screen saver using a Powershell script?
0
LesterJebson
Asked:
LesterJebson
  • 3
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
set-item -path 'HKCU:\Control Panel\Desktop\ScreenSaveActive' -value 0

Open in new window

you will need to reboot the machine to apply changes
1
 
LesterJebsonAuthor Commented:
Sedgwick,

This looks very close but it's giving me an error when I try to run it.  Is the syntax above correct?

Set-Item : The registry key at the specified path does not exist.
At C:\Temp\FixScreenSaver.ps1:1 char:9
+ set-item <<<<  -path 'HKCU:\Control Panel\Desktop\ScreenSaveActive' -value 0
    + CategoryInfo          : InvalidArgument: (HKEY_CURRENT_US...creenSaveActive:String) [Set-Item], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.SetItemCommand

Thank you
0
 
LesterJebsonAuthor Commented:
Sedgwick,

Thank you so much!  I slightly modified your example and it worked great.  This Powershell command turns off the screen saver.

set-ItemProperty -path 'HKCU:\Control Panel\Desktop' -name ScreenSaveActive -value 0
0
 
LesterJebsonAuthor Commented:
Thank you!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now