I use Server Power Control to Suspend my XP Squeezebox Server (or whatever it's called today). I also use the same computer to play movies, so I wanted to arrange for the the suspend to be conditional on the existence of the movie player process. To that end I cobbled together this VB script:
vset service = GetObject ("winmgmts:")
for each Process in Service.InstancesOf ("Win32_Process")
If Process.Name = "vlc.exe" or Process.Name = "mpc-hc.exe" then
wscript.quit
End If
next
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("c:\windows\scpowertool.exe --standby --log" & WScript.ScriptFullName)
wscript.quit
So, Server Power Control calls the VB script and the VB script only calls scpowertool if neither of my movie players is running. So far so good. The problem is that when the script runs it momentarily pops up a window which forces the movie player out of full screen mode. I'm stuck - suggestions welcome!
Tony
Results 1 to 2 of 2
Thread: Conditional Suspend
-
2012-05-06, 13:58 #1Member
- Join Date
- Dec 2009
- Posts
- 43
Conditional Suspend
Last edited by Wiredcharlie; 2012-05-07 at 01:04. Reason: error
-
2012-05-07, 01:03 #2Member
- Join Date
- Dec 2009
- Posts
- 43
Solved it! The command to enter in Server Power control is:
c:\windows\system32\wscript.exe C:\Progra~1\Scripts\standby.vbs (or path to your script)
Tony

Reply With Quote
