diff --git a/CLIENT_DATA/set_2nd_ip.vbs b/CLIENT_DATA/set_2nd_ip.vbs new file mode 100644 index 0000000..04f6765 --- /dev/null +++ b/CLIENT_DATA/set_2nd_ip.vbs @@ -0,0 +1,22 @@ +On Error Resume Next +Const HKEY_LOCAL_MACHINE = &H80000002 + +IParrData = Array("0.0.0.0", Wscript.Arguments(0)) +SubnetarrData = Array("0.0.0.0", Wscript.Arguments(1)) +strKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces" + +strComputer = "." + +Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _ +& strComputer & "\root\default:StdRegProv") + +Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") +Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter where NetConnectionStatus = 2 AND Name <> 'TAP-Win32 Adapter V9'",,48) +For Each objItem in colItems + Set colItems2 = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where index = "&objItem.index,,48) + For Each objItem2 in colItems2 + strKeyPath = strKeyPath &"\"& objItem2.SettingID + objWMI.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,"IPAddress",IParrData + objWMI.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,"SubnetMask",SubnetarrData + next +Next \ No newline at end of file