Get HomeSeer Now!

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

HomeSeer will probably provide native support for initiating and disconnecting an internet dialup connection sometime soon; but until then, I've figured out a pretty clean way to do just that. First of all, I have seen some conversations on the HomeSeer Message Board suggesting a program called DynamIP. While that may work okay, when I installed it and tested it, I found it to be overkill. If you need all those features, great. But in my case, all I need is a way to connect and disconnect to the internet.

So, I'm using two very small programs, one to connect and one to disconnect. They are both very simple to setup, and they both only require the use of a single executable file (no automated installation or DLLs, etc.) And best of all, they are both free.

To connect, I use "Dialup v0.1" (which you can dowload below) and to disconnect, I use "Connection Manager" (which you can download from their web site).

-

Installation

  1. Download "Connection Manager" from its web site. Also, download "Dialup" from the following link:
    download dialup.zip (4Kb)

  2. In your "Program Files" directory, create two new directories, one for each of these programs.

  3. Unzip each of the two files into their respective directories.

-

Connect To and Disconnect From the Internet in a VBScript

To connect to the internet in a script, use the Launch function to call "dialup.exe", passing it the name of the DUN connection that you want it to start:

          hs.Launch "c:\program files\dialup\dialup.exe","Your DUN Name"
          hs.Wait 12

To disconnect from the internet in a script, use the Launch function to call "connectionmanager.exe", passing it "/h" to tell it to hang up now:

          hs.Launch "c:\program files\connectionmanager\connectionmanager.exe","/h"
          hs.Wait 7

-

Sample VBScript

I have created a script that dials up to the internet, sends an e-mail, then disconnects. You can download it here:

          download internet_connect.txt (2Kb)

-

Determining Current Online Status

You can use the GetIPAddress function to see if you're already on the internet. The best way to set this up is to run it once while you're offline and see what it returns. Then go online and run it again to see what it returns. Based on the differences between the two, you can set up an If statement to determine if you're online before connecting.

-


Get HomeSeer Now! Copyright © 1997-2008 Scott M. Crevier
Wed 14-Nov-2001
www.x10.crevier.org
-Click here for a $15 Gift Certificate!
Scott Crevier's Home Automation
-