TempFileName="c:\Tempfile.txt" 'Any temporary location IPAddressToPost=2 'Run IPCONFIG from a DOS prompt...which IP address is the one you want? IPStringInFile="IP Address. . . . . . . . . : " '--------------------------------------------------------------------- 'oShell is used to run the command-line IPCONFIG program to find the IP addresses. set oShell=CreateObject("WScript.Shell") iReturnValue=oShell.run("ipconfig /batch " & TempFileName,1,true) 'Open the 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) sIPString=oFile.ReadAll oFile.Close set oFile=nothing 'Look for the correct IP address, since computers can have multiple ones. nIPAddressLocation=1 'Start at the very beginning... for nMoveThroughIPAddresses = 1 to IPAddressToPost nIPAddressLocation=InStr(nIPAddressLocation,sIPString,IPStringInFile) nIPAddressLocation=nIPAddressLocation + Len(IPStringInFile) next 'OK, we found the IP address, now make sure we don't grab anything else 'besides the actual IP address (we don't want the trailing characters) nLastDigitAtLocation=15 for nCounter = 0 to 15 sThisChar=Mid(sIPString,nIPAddressLocation+nCounter,1) if sThisChar = vbLf or sThisChar = vbCr then if nCounter < nLastDigitAtLocation then nLastDigitAtLocation = nCounter end if end if next 'Put the IP address into the sIPAddress string for use later. sIPAddress=Mid(sIPString,nIPAddressLocation,nLastDigitAtLocation) rem add various routes through WN dial-up rem routes to PWP publish and ftp servers: iReturnValue=oShell.run("route add 204.159.38.0 MASK 255.255.255.0 " & sIPAddress, 1, true) rem routes to MSWS and WN homepage: iReturnValue=oShell.run("route add 204.127.43.0 MASK 255.255.255.0 " & sIPAddress, 1, true) iReturnValue=oShell.run("route add 204.127.12.0 MASK 255.255.255.0 " & sIPAddress, 1, true) rem routes to netnews servers: iReturnValue=oShell.run("route add 204.127.36.0 MASK 255.255.255.0 " & sIPAddress, 1, true) rem routes to postoffice server: iReturnValue=oShell.run("route add 204.127.5.0 MASK 255.255.255.0 " & sIPAddress, 1, true) rem routes to mailhost server: iReturnValue=oShell.run("route add 204.127.8.0 MASK 255.255.255.0 " & sIPAddress, 1, 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