Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Hibernate / Sleep remote computer w/ DCC Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
crisx
Groupie
Groupie
Avatar

Joined: September 14 2006
Location: United States
Online Status: Offline
Posts: 72
Posted: October 31 2007 at 17:52 | IP Logged Quote crisx

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 View crisx's Profile Search for other posts by crisx
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 05 2007 at 13:27 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
crisx
Groupie
Groupie
Avatar

Joined: September 14 2006
Location: United States
Online Status: Offline
Posts: 72
Posted: November 06 2007 at 11:15 | IP Logged Quote crisx

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 View crisx's Profile Search for other posts by crisx
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum