Exit For
End If
Next
'重启网卡
For i = 1 To 2
For Each verb in oLanConnection.verbs
If RegExpTest("启用|禁用|停止", verb.Name)>0 Then
verb.DoIt
Exit For
End If
Next
'有时网卡半天反应不过来,可以把这个参数设的大点一般程序可以正常运行,或您多运行几次程序
WScript.Sleep 5000
Next
End Function
'正则测试有没有匹配内容
Function RegExpTest(patrn, strng)
Set re = New RegExp
re.Pattern = patrn
re.IgnoreCase = True
re.Global = True
Set Matches = re.Execute(strng)
RegExpTest = Matches.Count
End Function







