added vbs
This commit is contained in:
parent
2e59c8d317
commit
0827f8e738
22
CLIENT_DATA/set_2nd_ip.vbs
Normal file
22
CLIENT_DATA/set_2nd_ip.vbs
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user