37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
On Error Resume Next
|
|
|
|
Const HKEY_LOCAL_MACHINE = &H80000002
|
|
'Const FULL_DNS_REGISTRATION = True
|
|
'Const DOMAIN_DNS_REGISTRATION = False
|
|
|
|
strComputer = "."
|
|
|
|
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
|
|
strComputer & "\root\default:StdRegProv")
|
|
|
|
strKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
|
|
|
|
strValueName = "SearchList"
|
|
|
|
Set objWMIService = GetObject("winmgmts:" _
|
|
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
|
|
|
|
Set colNetCards = objWMIService.ExecQuery _
|
|
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
|
|
|
|
For Each objNetCard in colNetCards
|
|
if objNetCard.Description = "TAP-Win32 Adapter V9" then
|
|
objNetCard.SetDynamicDNSRegistration True, _
|
|
False
|
|
objNetCard.SetTcpipNetbios 0
|
|
|
|
else
|
|
objNetCard.SetDynamicDNSRegistration False, _
|
|
False
|
|
objNetCard.SetTcpipNetbios 2
|
|
end if
|
|
Next
|
|
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
|
|
if strValue <> "" then
|
|
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,""
|
|
end if |