Jump to content

Detect Screensaver On Remote PC?


jestermgee
 Share

Recommended Posts

I'm at a stage where I want to start automating the power saving on my HTPC media servers. I already have a simple script that pings clients and when all clients are offline the Media server shuts down, but now I have another mission.

I leave the HTPC on most of the time so it can record TV, compress shows etc. The screensaver kicks in when not in use and the monitor shuts down after 40 minutes. When the monitor shuts off it basically means no one is using the machine.

I would like to create a script to run on the server that can detect if either the monitor has shutoff OR just if the screensaver is running and then shutdown the server. This is where i'd like to start, then i'd like to build in a couple of other checks also such as traffic monitoring etc, but I'll start here.

Any starters on how to:

- Check locally if a screensaver is running

- Check remotely?

Cheers for any help

Link to comment
Share on other sites

I'd say pretty much the best way is to check is see if the screen save is active, see what the screensaver is set too, and see if the screensaver exe is running.

Look in the registry here: HKEY_CURRENT_USER\Control Panel\Desktop

ScreenSaveActive (i.e. 1 = Screensaver Enabled)

SCRNSAVE.EXE (i.e. C:\WINDOWS\system32\ssflwbox.scr)

Use the ProcessExists() func to see if ssflwbox.scr is running.

For remote you can use the internal REG funcs and wmi to see if a process (ssflwbox.scr) is running.

Edited by spudw2k
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...