'Routing Script for AT&T WorldNet for Win 9x Computers with multiple connections 'Assumes that AT&T WorldNet IPs begin with 12 'Change the AT&T WorldNet DUN connectoid pointed to so it does NOT use the default gateway TempFileName = "c:\Tempfile.txt" 'Any temporary location -- you pick it IPInString = "IP Address" 'String to search for in IPCONFIG output IPNumber = "12." 'Beginning octet WN IP address WorldNetDUN = "C:\WINDOWS\Desktop\WorldNet.DUN" 'Location & name of AT&T WorldNet DUN connectoid '--------------------------------------------------------------------- 'oShell is used to run the command-line IPCONFIG program to find the IP addresses. set oShell=CreateObject("WScript.Shell") iReturnValue=oShell.run(WorldNetDUN,1,true) iReturnValue=oShell.run("ipconfig /batch " & TempFileName,0,true) 'Open the temp file generated from the above code 'and assign it to a variable so it can be parsed. Const ForReading = 1, ForWriting = 2, ForAppending = 3 set oFileSystem = CreateObject("Scripting.FileSystemObject") set oFile = oFileSystem.OpenTextFile(TempFileName, ForReading) sFlag = 0 'Search for IPs and check if in right domain Do While oFile.AtEndOfStream <> True sIPAddress = oFile.ReadLine 'Read line of temporary file If InStr(sIPAddress,IPInString) <> 0 then 'Find line start with IP Address ColonPos = InStr(21,sIPAddress,":") 'Find position of colon sIPAddress = Mid(sIPAddress,ColonPos+2) 'Extract IP portion 'Check for correct IP If Trim(Left(sIPAddress,Len(IPNumber))) = IPNumber then sFlag = 1 'Found WN IP so set flag Exit Do 'and get out of the loop End If End If Loop 'Look for next IP If sFlag = 1 then 'Found WN IP so process route table oFile.Close set oFile=nothing 'add various routes through WN dial-up 'routes to PWP publish and ftp servers: iReturnValue=oShell.run("route add 204.159.38.0 MASK 255.255.255.0 " & sIPAddress, 0, true) 'routes to MSWS: iReturnValue=oShell.run("route add 204.127.43.0 MASK 255.255.255.0 " & sIPAddress, 0, true) iReturnValue=oShell.run("route add 204.127.12.0 MASK 255.255.255.0 " & sIPAddress, 0, true) 'routes to netnews servers: iReturnValue=oShell.run("route add 204.127.36.0 MASK 255.255.255.0 " & sIPAddress, 0, true) 'routes to postoffice server: iReturnValue=oShell.run("route add 204.127.5.0 MASK 255.255.255.0 " & sIPAddress, 0, true) 'route to SMTP server iReturnValue=oShell.run("route add 204.127.8.0 MASK 255.255.255.0 " & sIPAddress, 0, true) 'route to WURD server iReturnValue=oShell.run("route add 204.127.237.0 MASK 255.255.255.0 " & sIPAdress, 0, true) 'routes to home page iReturnValue=oShell.run("route add 135.145.0.0 MASK 255.255.0.0 " & sIPAddress, 0, true) 'Delete temporary file. oFileSystem.DeleteFile TempFileName,true 'Cleanup set oTXTFile = nothing set oFileSystem = nothing set oShell = nothing MsgBox "AT&T WorldNet access routed to " & sIPAddress else MsgBox "Failed to find AT&T WorldNet IP Address of form 12.xx.xx.xx" end if