The main probelm youare facing is that the default gateway is defined on a per-NIC basis in the computers registry. Therefore, you can either use NETSH for Windows 2000/XP or write a UDf that changes just the default gateway. You already got some of those pieces in our private email conversation. Additionally, you will need to make those changes under an administratvie account which means either scheduling it with the Task Scheduelr or using SU.EXE if the changes must be applied during the login process.
Therefore your script needs to do the following things.
1) Read in the computers IP address, e.g. IP=split(@IPADDRESS0,'.') will give you an array of four octets of the IP address.
2) Read from e.g. a .INI file the old/new gateway combinations. If the new gateway is based on the old gateway, make it
code:
[GatewayList]
OldGateway=NewGateway
otherwise do it e.g. based on network ID:
code:
[NetworkIDList]
NetworkID=NewGateway
2) Use any of the appropriate subnet UDFs to decide the new gateway IP.
3) Change the registry keys fro the computers NIC from the old gateway to the new one.
The UDF CheckNICS() that I sent you does those things. It does look complicated because it has to cover different operatings systems and thus different ways of storing the gateway info. It also has to be so generic as to work with any kind of NIC, who are all stored in different places in the registry.
_________________________
There are two types of vessels, submarines and targets.