Author |
|
crisx Groupie
Joined: September 14 2006 Location: United States
Online Status: Offline Posts: 72
|
Posted: October 31 2007 at 17:52 | IP Logged
|
|
|
I'm trying to have powerhome put my remote computers running VISTA into sleep mode. I'm using DCC to do it. Hibernation was fairly easy, executing "shutdown /h" on the remote computer. As far as I can tell, there is no way from the command line to have the computer enter sleep (standby in XP) mode, so I have adopted an ugly work around:
Code:
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^{ESC}"
WScript.Sleep 10
WshShell.SendKeys "{RIGHT}"
WshShell.SendKeys "{RIGHT}"
WshShell.SendKeys "{RIGHT}"
WshShell.SendKeys "{UP}"
WshShell.SendKeys "{UP}"
WshShell.SendKeys "{ENTER}"
|
|
|
This works fine from the local computer, but when the file is ran from a ph macro:
Code:
ph_ssrequest("192.168.0.101",8500,"user","pw","FORMULA","ph_ run('c:\program files\PowerHome\DCC\SleepVista.bat')")
|
|
|
, it runs on my local powerhome computer, not the remote computer.
Any ideas? Is there an easier way to do this?
Thanks,
Cris
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: November 05 2007 at 13:27 | IP Logged
|
|
|
Cris,
I did a quick Google, and it appears this command will put a Vista (or XP) machine to sleep:
rundll32 powrprof.dll,SetSuspendState
So, I would think that your code would look like:
ph_ssrequest("192.168.0.101",8500,"user","pw","FORMULA","ph_ run('rundll32 powrprof.dll,SetSuspendState')")
Dave.
|
Back to Top |
|
|
crisx Groupie
Joined: September 14 2006 Location: United States
Online Status: Offline Posts: 72
|
Posted: November 06 2007 at 11:15 | IP Logged
|
|
|
Dave,
Thanks for the response. I had found the same information, and when I ran
rundll32 powrprof.dll,SetSuspendState
the computer enterend hibernation instead of sleep mode. After a little more research, I found out if hibernation is enabled (the checkbox in the power settings tab of control panel), the computer will hibernate with the setsuspendstate command. If hibernation is disabled, that command will send the computer into sleep mode.
So that still leaves me unable to remotely put a vista computer into sleep mode. I'm trying to sleep my HTPC overnight. It wakes and records much more reliably from sleep mode than from hibernation mode, but I still occasionally use hibernation, so I'd like both options. Not an urgent matter by any means, but do you have any other ideas?
Thank you,
Cris
Edited by crisx - November 06 2007 at 11:46
|
Back to Top |
|
|
|
|