openvpn.config/CLIENT_DATA/reghack2.vbs

37 lines
1.1 KiB
Plaintext
Raw Normal View History

2012-04-05 14:33:15 +02:00
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