I have seen lots of posts regarding how to determine the connectiontype when NOT connected via RAS,
could this solve the problem?

Maybe some of you with a modem connection at hand could check if this actually works ?


Check if connected via modem or NIC

To make this work, you must download: dial_up_networking_manager.zip

Unpack the zip-file, and execute: ic.EXE (contained in the ZIP)
This will create the COM-interface: VMK.InternetConnect.1

code:
Function ModemConnected()
; This function checks if you are connected via modem
;
; Parameters: None
;
; Example:
; If ModemConnected()
; ? "You are connectet via Modem"
; Else
; ? "You are connectet via a network interface card"
; EndIf
;
; Requires:
; KiX 4.01 or greater
; COM-interface: VMK.InternetConnect.1 (http://cwashington.netreach.net/downloads/com/dial_up_networking_manager.zip)

$oConnection = CreateObject("VMK.InternetConnect.1")

If ($oConnection.ConnectionType = 1) Or ($oConnection.ConnectionType = 8)
$ModemConnected = 1
Else
$ModemConnected = 0
EndIf
EndFunction


- Erik


ps.
I have no way of testing, i have no modem-connected ws's available!


Following script shows some of the methods for using InternetConnect

Coverted version of Logon/Logoff.vbs

code:

Break On

$oConnection = CreateObject("VMK.InternetConnect.1")

If $oConnection

; ConnectionType can be one of:
; 1: Modem
; 2: Lan
; 4: Proxy
; 8: Modem(Busy)
;
; ConnectionTypeString is an english language string representation of ConnectionType.
;
? "Connected = " + $oConnection.Connected
? "ConnectionType = " + $oConnection.ConnectionType
? "ConnectionTypeString = " + $oConnection.ConnectionTypeString

; Setting the Connected property will connect or disconnect modem connection from the Internet.
If ($oConnection.ConnectionType = 1) Or ($oConnection.ConnectionType = 8)
If $oConnection.Connected = 0
$n = MessageBox("Connect to the Internet?","Connect", 4 + 64)
If $n = 6
$oConnection.Connected = 1
EndIf
Else
$n = MessageBox("Disconnect from the Internet?","Disconnect", 4 + 64)
If $n = 6
$oConnection.Connected = 0
EndIf
EndIf
EndIf

EndIf