jestermgee Posted September 30, 2008 Share Posted September 30, 2008 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 More sharing options...
spudw2k Posted October 1, 2008 Share Posted October 1, 2008 (edited) 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 October 1, 2008 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now