• ARTICLES
• SUBSCRIBE
SEARCH

## How to Make Windows Start the Screensaver Immediately When Locked

Are you one of those people that loves to see the screensaver come on when you get up from your computer? Here’s an easy way to make the screensaver show up as soon as you lock your PC.

To lock your computer, if you’ve never tried it, just use the WIN + L shortcut key combination, and your computer will be locked – you’ll have to enter the password to get back in. It’s a really good idea to do so at work, or if your friends are the type that will mess with your PC while you’re in the other room.

You can also create a shortcut that will lock your computer, if you are the type of user that prefers using a mouse to tediously do things instead of a nearly-instant shortcut key. Just paste this into the location box when creating the shortcut:

rundll32.exe user32.dll, LockWorkStation

Note: according to some very technical documentation, it’s possibly not a good idea to create shortcuts to lock the desktop. Plus, again, WIN + L is a much better solution.

Now that you know how to lock your PC, it’s time to make sure your screensaver is enabled. If it already is enabled, then skip down a bit.

Right-click on the desktop, choose Personalize, and then click on Screen Saver on the bottom right-hand side of the window.

Now you’ll want to configure your favorite screensaver. You can download more screensavers from ye olde interwebs… but be very careful. There are a lot of viruses hidden in those downloadable screensavers. Make sure to scan for viruses.

Now to start the screensaver immediately, you’ll need to download the free and open source MonitorES utility, which is a really small tool that does a bunch of interesting things, one of which is automatically enable the screensaver.

Download, install, and then open the tool. Go into the preferences (accessible from the system tray icon), and choose the Auto SSaver On option.

Now use WIN + L to lock your computer. The screensaver should show up instantly.

It’s worth noting that you should really ignore this entire tutorial and just set your monitor to turn off quickly when you’re not using it, because that saves electricity, which saves you money on your bill. Which gives you more money to buy geek stuff. And coffee.

## Notable Replies

1. Iszi

Good point about shutting off the monitor, vs. screensaver.

I'd be really interested to know if there's a way to achieve the same goal via Task Scheduler instead of third-party software. It's much preferable to do tweaks like this via features and apps native to the OS, instead of adding more bloat to the computer for each bell & whistle. I'm actually a little disappointed every time I see a "How to" article here that recommends adding more software to do a task that doesn't need it.

EDIT:

Looks like it's totally doable (in theory - not thoroughly tested 'cause I'm not on a good test system right now) in Task Scheduler. Set the task to trigger on workstation lock, and point it to your favorite .scr file.

2. Iszi

Cool! Glad to be an inspiration!

As I mentioned in my first post, it's always better to do things with the tools you already have. So, I'm a bit disappointed whenever I see an HTG article recommending yet another specialized piece of software for a task that probably doesn't need one.

It's great to see how everyone's worked together here to brainstorm up a better solution. I'm loving this community more every day.

3. Netpilot

I dunno, I'm still a stubborn purist. I still wish there was a way to do this natively, as Iszi said earlier.

4. taygibb

I got it working, absolutely no software required.

So create a new PowerShell script somewhere on your PC and paste this into it:

$SendMessage = Add-Type -MemberDefinition @" [DllImport("user32.dll")] public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam); "@ -Name "Win32SendMessage" -Namespace Win32Functions -PassThru$SendMessage::SendMessage(0xffff, 0x112, 0xF140, 0)

Then create a new schedule task to execute when you lock your workstation and set it to run powershell.exe and in the arguements type:

-file "C:\path\to\your\powershellfile.ps1"

That's all there is too it. Also i have to give props to @geek becuase i basically just ported his work to PowerShell so we dont have to use any tools. I woke up at 1.15 am to write this so i hope someone finds it useful.

Tested on Windows 8 Pro.

5. taygibb

@geek You can remove it, i said that because i was lazy. Turns out i was wrong. It works with PowerShell 2, its just discourse formatted the text so it broke it. Heres a working version tested on PowerShell 2.

$SendMessage = Add-Type -MemberDefinition @" [DllImport("user32.dll")] public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam); "@ -Name "Win32SendMessage" -Namespace Win32Functions -PassThru$SendMessage::SendMessage(0xffff, 0x112, 0xF140, 0)



Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

• Published 04/10/13