Page 1 of 1

OT: Somewhat: PC wake-up program?

Posted: Wed Dec 24, 2008 3:42 pm
by Steve Horn
Excuse the somewhat off-topic.. but if anyone is going to know how to do this you guys will. I'd like to install a program on my PC what will wake it up out of standby every hour or so (variable maybe) so that it can go off and find updates to my virus and spyware programs. Typically, I keep my "everyday" PC in standby mode when not using it. But when I actually want to use it it takes sometimes many minutes to get to the point where I can actually DO something. In the meantime the virus (avast) and spyware (Spysweeper) programs poll their hosts and if updates are available they are downloaded and installed. Necessary but a royal PITA to wait on. So I figured if I had a program that woke up the PC several times a day those updates would already be taken care of by the time I actually wanted to use the PC for something. But maybe I'm getting old and cranky. :oops:

Re: OT: Somewhat: PC wake-up program?

Posted: Thu Dec 25, 2008 10:09 am
by roussell
Depending on the age of the computer, it may have startup and shutdown times in the BIOS. Alternatively, to wake up the PC, you can send it a WOL (Wake-On-LAN) packet from another computer. Here's a VBScript example based on the UltraWOL COM object from UltraJones: http://www.robvanderwoude.com/vbstech_network_wol.html

Code: Select all

Dim objWOL

Set objWOL = CreateObject( "UltraWOL.ctlUltraWOL" )

objWOL.BroadcastAddr = "192.168.0.255"
' The MAC address of the computer to be woken
objWOL.MACAddr = "AA-BB-CC-DD-EE-FF"
' The local computer's IP address
objWOL.LocalIP = "192.168.0.4"
objWOL.WakeUp
Terry

Re: OT: Somewhat: PC wake-up program?

Posted: Thu Dec 25, 2008 12:54 pm
by Steve Horn
Thanks Terry, I'll try it once the Christmas dust settles.

Re: OT: Somewhat: PC wake-up program?

Posted: Thu Dec 25, 2008 2:06 pm
by Steve Horn
Interesting. Works like a champ :D outside of HB, i.e. called from an file explorer window. But creating a device and running it from within the HB server does not wake up the target PC. The History tab for the device shows it going from stopped to running then back as it should but the PC is not awakened.

Re: OT: Somewhat: PC wake-up program?

Posted: Thu Dec 25, 2008 6:15 pm
by Osler
Then try using an execute program device and Cscript or Wscript with command line args pointing to the script. This will run it external to HB.

Osler

Re: OT: Somewhat: PC wake-up program?

Posted: Thu Dec 25, 2008 6:31 pm
by Steve Horn
Over my head :oops: I was working within HB so that I could set a timer to run the wake-up script periodically. Besides. it SHOULD run from within HB. (Actually it does run; it just doesn't do anything.) I'll work on it more this weekend.

Re: OT: Somewhat: PC wake-up program?

Posted: Thu Dec 25, 2008 11:59 pm
by Osler
cscript.exe is the command line way to access the windows scripting host. If you set up a execute program device (instead of a script device) for the program cscript.exe and put the full path to the script you want to execute in the command line arguments parameter of the execute program device, it will run the script, not using the scripting host provided in HB but the full version included with Windows.

Progam to execute: C:\WINDOWS\SYSTEM32\cscript.exe

Command Line Parameters: C:\Program Files\HouseBot\Config\Scripts\<my script>.vbs

You may need quotes around the command line parameters.

Also, check to make sure you have your firewall permission set correctly for HB to access the network.

Osler

Re: OT: Somewhat: PC wake-up program?

Posted: Fri Dec 26, 2008 8:09 am
by Steve Horn
"I see!" said the blind man. I'll try it tonight. Thanks to you both for the help.

Re: OT: Somewhat: PC wake-up program?

Posted: Sat Dec 27, 2008 6:30 pm
by Steve Horn
Works great! Thanks for the help and cscript lesson; I learned something new - never too old. :D