Get HomeSeer Now!

CREVIER
HomeSite Map
Categories
Pages
-
-
Scott Crevier
scott@crevier.org
-
HomeSeer Knowledge Base
-
Internet Connection Script (via Windows Scripting)
-
Submitted by: Scott Crevier <scott@crevier.org>21-Mar-2000Doc #1002

There was a discussion on the HomeSeer Message Board suggesting the use of Windows Scripting to connect to and disconnect from the internet. I found that solution to work nicely at first, but since it's based primarily on being able to send keystrokes to Windows, it proved to be unreliable for my use.

The main problem I had was if the script ran while I was using the PC, my own keystrokes interfered with those sent by the script to dialup to the internet. Also, even if I'm not using the PC, there may be something else running that would conflict with the keystrokes sent by the script. However, everyone's situation is different. You might be running this on a PC that has little or no user input. And as such, this Windows Scripting solution may work well for you.

So, below are two scripts, one for connecting and one for disconnecting. These scripts need to be named with the ".vbs" extension (not .txt). You can setup an event in HomeSeer (one for connecting and one for disconnecting) that runs a script from the "Launch Application" window (not the Script window).

In order for this to work, you need to define a Shortcut Key to start your internet connection. One way to do that is to drag your connection icon from the Dialup Networking window to your desktop (with the right mouse button) and create a shortcut. Then right click on that new icon, go into the properties and enter the Shortcut Key you want to use. The scripts below assume that you're using Ctl-Alt-D for this shortcut.

You also need to have the latest version of Windows Script installed. I've tested this with Windows Script 5.1.

-
dunstart.vbs:
Set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "HomeSeer"
WshShell.SendKeys "^%d"
Wscript.Sleep 4000
WshShell.SendKeys "{ENTER}"
dunstop.vbs:
Set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "HomeSeer"
WshShell.SendKeys "^%d"
Wscript.Sleep 7000
WshShell.SendKeys "%c"
-

The best I can tell, the above scripts are a combination of the efforts of Vijay Anand and Sarah in the HomeSeer Message Board.


Get HomeSeer Now! Copyright © 1997-2008 Scott M. Crevier
Thu 30-Mar-2000
www.x10.crevier.org
-Click here for a $15 Gift Certificate!
Scott Crevier's Home Automation
-