Function CHANGEIP(Cardid, ip, mask)
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colNetAdapters = objWMIService.ExecQuery _
        ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strIPAddress = Array(ip)
strSubnetMask = Array(mask)
strGateway = Array("")
strGatewayMetric = Array(1)
    For Each objNetAdapter in colNetAdapters
	        If objNetAdapter.SettingID = Cardid Then
               errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
               errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
			   CHANGEIP = 5
	        End If
    Next
End Function
Function Main()
    Set objArgs = WScript.Arguments
    priv_con = objArgs(0)
	ip = objArgs(1)
	mask = objArgs(2)
    Main = CHANGEIP(priv_con,ip,mask)
End Function
Main()
