DiGiTAL
Mon Jan 23 12:21:45 CST 2006
You could try having them perform a IPCONFIG, capture the output, and
then parse through it for what you want. After that, utilize the netsh
command to set the default gateway.
This code should echo back the default gateway IP.
Warning: Untested
Dim oShell
Dim oShellExec, oStdOutputText,sText, aText, sCMD
sCMD = "%comspec% /c ipconfig"
Set oShell = CreateObject("Wscript.Shell")
Set oShellExec = oShell.Exec(sCMD)
set oStdOutputText = oShellExec.StdOut
Do While Not oStdOutputText.AtEndOfStream
sText = oStdOutputText.ReadLine
If InStr(sText, "Default Gateway") <> 0 Then
aText = split(sText,":")
exit do
End If
Loop
wscript.echo "Gateway = " & trim(aText(1))
---
Life is all about ass; you're either covering it, laughing it off,
kicking it, kissing it, busting it, trying to get a piece of it,
behaving like one, or living with one!
*** Sent via Developersdex
http://www.developersdex.com ***