How To Disable Your Windows Screensaver With Motion Detection

Ryan Dube 13-04-2011

disable screen saverWhile password-locked screensavers are a security necessity at many businesses, in most homes the screensaver’s only real purpose is to…well…save the screen. It can become a little bit of an annoyance to have to tap the keyboard or move the mouse whenever you walk up to the computer to see what’s going on. It’s especially annoying if you have scans running or some other activity that you just want to monitor over a long period of time. The screensaver will kick in, and you have to tap the keyboard or move the mouse to remove it.


Wouldn’t it be cool if your computer acted a little bit more like one of those advanced computers you read about in science fiction novels, where you can simply walk up to it and it can sense that you are there and respond accordingly? I mean, these days almost every computer comes with a webcam of some sort, often embedded right above the monitor, so the potential for smarter, more automated computers is there.

There may be some newer computer systems that already do this, but for the most part people are still stuck with tapping the keyboard to disable the screen saver. I started thinking about this the other day and decided to try to put together a combination of applications and scripts that would accomplish this simple automation task (yes, these are the sorts of things automation engineers do for fun).

The Motion-Detection Screensaver Solution

What I came up with was an application-script combination that would constantly monitor the webcam for motion, and then instantly run a script that would remove the screensaver. Deciding on the webcam software was easy. I was tempted to use the Active Webcam How To Build A WiFi Home Surveillance System With Your PC Read More software that I previously wrote about, but then I realized that YawCam, which Mark covered before 2 Cool Motion Sensor Webcam Tools to Snap Those Intruders Read More , is much simpler and more effective for this sort of task.

Once you install and run YawCam (and give them a nice donation for offering us this free software), you’ll see the following screen over the webcam video.

disable screen saver


Click on “Window” and then choose Motion detection from the dropdown list. On the next screen, you’ll see a page where the motion detection software logs each time a motion event takes place (when the detection is activated). Click on the “Actions” tab to set up the file that you’ll have YawCam run whenever motion is detected.

automate screen saver

On this screen, you’ll see a “Settings…” button next to Run.exe. Select the checkbox next to “Run.exe” and then click on the settings button.

automate screen saver


Click on the Activate check box for flood control (you don’t want the script launching 50 times a second), and put some delay (I put 10 seconds, but you can use up to 60 or more). The next step would be to click on the browse button and choose your script file that you want to run. Alas, you don’t have one yet. Don’t worry, I’ve got you covered.

You’ll notice that the default filter looks for .bat or .exe files, but you can also choose a Windows Script file (.wsf). For this article, I hunted for a whole list of ways to kill the screensaver via script. I searched for programs that already exist, or batch job methods that disable the screen saver. In each of those cases the screensaver stays disabled – not good. So then I turned to methods to send keyboard keys or mouse clicks to Windows – and sure enough, that was the solution.

After digging around Microsoft help files, I found the SendKeys code that simulates pressing the “Enter” button on the keyboard.

The following is the script.


<script language=”VBScript”>
set WshShell = WScript.CreateObject(“WScript.Shell”)

Save this script to a .wsf file and point the Action event in YawCam to that file. Now, every time there’s motion in the webcam, it’ll kick off your script, which simulates pressing the keyboard enter key – which will disable the screen saver.

If you find that your script isn’t getting launched or the motion detection doesn’t seem to be working (or it’s too sensitive), make sure to check out the “Settings” tab in YawCam. Make sure that the tolerance is high enough so it’s not too sensitive, and make sure the sensitivity is high enough so that it picks up when you sit down in front of the computer.

disable screen saver

As with most automated solutions, this one isn’t perfect yet because you have to turn it off when you actually want to use the computer or it’ll keep sending the “Enter” key whenever there’s motion. I’m sure there are other creative ways you can probably perfect this automated screensaver trick. The solution above will work best for situations where you have something running for hours (like a virus scan) and you want to just walk up to the screen and have it automatically show you what’s going on, but then the screensaver will reactivate after you walk away.


Did you install this automated screensaver setup? How well did it work for you? Did you find a way to perfect the system even more? Share your insights in the comments section below.

Image Credit: Vivek Chugh

Related topics: Screensaver, Webcam.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Patricia Newton
    April 3, 2018 at 1:53 pm

    Please help me I believe thosnisninstalled in my phone and I need to have it removed what do I do

  2. Joe
    February 20, 2016 at 4:07 am

    I don't know if this is still monitored but, is there anyway i can make it so it mouse clicks instead of pressing enter? It seems to not wake up the display with enter

  3. Guest
    April 16, 2011 at 9:21 pm

    The error is because of the quotes. They look the same but they are not valid for a script file. Just delete the double quote marks and type use the quote keys from your keyboard.

  4. Joel Soihet
    April 14, 2011 at 8:43 pm

    With W7 just personalise a or all screensavers as "none" and you get rid of them.

  5. Panos_alexo
    April 14, 2011 at 12:26 am

    the main part works like a charm, the only thing is that the script get an error
    line 3
    character 10
    error: the value for the attribute is not valid : language
    code: 80040049

    • Anonymous
      April 14, 2011 at 2:26 am

      Panos - make sure you didn't leave off any of the "" as that is the most common culprit...

  6. Mubeen_3162003
    April 13, 2011 at 11:38 pm

    Can we do this in linux??

    • Anonymous
      April 14, 2011 at 2:25 am

      Linux...I wouldn't even know where to start! Maybe one of the Linux gurus around here would know...