找到一段代码,用于设置Windows下的网络连接认证属性
但执行的时候始终提示第2行字符1有8004100E的代码错误
请各位高手指正,谢谢!
但执行的时候始终提示第2行字符1有8004100E的代码错误
请各位高手指正,谢谢!
const HKEY_LOCAL_MACHINE = &H80000002
Set oReg=GetObject("Winmgmts:rootdefault:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
Dim oreg2
Set oreg2 = WScript.CreateObject("WScript.Shell")
strKeyPath = "HKLM\" & strKeyPath & "\"
strKeyPath2 = "SOFTWARE\Microsoft\EAPOL\Parameters\Interfaces\"
binValue = Array(&H05, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H40, &H0d, &H00, &H00, &H00, &H20, &H00, &H00, &H00, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H33, &H11, &H22, &H0d, &H00, &H00, &H00, &H28, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H28, &H00, &H00, &H00, &H05, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00, &H00)
For Each subkey In arrSubKeys
strSubkeyPath = strKeyPath & subkey & "\ServiceName"
strValue = oreg2.RegRead(strSubKeyPath)
strSubkeyPath2 = strKeyPath2 & strValue
Returnvalue = oreg.SetBinaryValue(HKEY_LOCAL_MACHINE, strSubkeyPath2, "1", binValue)
If Returnvalue <> 0 Or Err.Number <> 0 Then
oreg.CreateKey HKEY_LOCAL_MACHINE, strSubkeyPath2
oreg.SetBinaryValue HKEY_LOCAL_MACHINE, strSubkeyPath2, "1", binValue
End If
Next
