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).
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"
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"
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.