openvpn.config/CLIENT_DATA/reghack.vbs

35 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2012-04-05 14:33:15 +02:00
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
2012-04-10 14:58:23 +02:00
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
Set oReg2=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
2012-04-05 14:33:15 +02:00
strComputer & "\root\default:StdRegProv")
2012-04-10 14:58:23 +02:00
2012-04-05 14:33:15 +02:00
strKeyPath = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
2012-04-10 14:58:23 +02:00
2012-04-05 14:33:15 +02:00
strValueName = "DriverDesc"
For Each subkey In arrSubKeys
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath&"\"&subkey,strValueName,strValue
if strValue = "TAP-Win32 Adapter V9" Then
strValueName2 = "MTU"
2012-04-10 14:58:23 +02:00
strValue2 = "1400"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath&"\"&subkey,strValueName2,strValue2
strValueName3 = "NetCfgInstanceId"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath&"\"&subkey,strValueName3,strValue3
2012-04-05 14:33:15 +02:00
2012-04-10 14:58:23 +02:00
strKeyPath2 = "SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002bE10318}\"&strValue3&"\Connection"
If oReg2.EnumKey(HKEY_LOCAL_MACHINE,strKeyPath2,arrSubKeys2) <> 0 Then
oReg2.CreateKey HKEY_LOCAL_MACHINE,strKeyPath2
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath2,"PnpInstanceID","ROOT\NET\0000"
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath2,"MediaSubType",1
end if
strValueName4 = "Name"
strValue3 = "LAN-Verbindung OpenVPN"
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath2,strValueName4,strValue3
end if
2012-04-05 14:33:15 +02:00
Next