网络连接状态建立于断开的VBS脚本_vbs教程-查字典教程网
网络连接状态建立于断开的VBS脚本
网络连接状态建立于断开的VBS脚本
发布时间:2016-12-28 来源:查字典编辑
摘要:断开连接提示复制代码代码如下:strComputer="."SetobjWMIService=GetObject("winmgmts:"&s...

断开连接提示

复制代码 代码如下:

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & strComputer & "rootwmi")

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _

("Select * from MSNdis_StatusMediaDisconnect")

Do While True

Set strLatestEvent = colMonitoredEvents.NextEvent

Wscript.Echo "A network connection has been lost:"

WScript.Echo strLatestEvent.InstanceName, Now

Wscript.Echo

Loop

建立连接提示

复制代码 代码如下:

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & strComputer & "rootwmi")

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _

("Select * from MSNdis_StatusMediaConnect")

Do While True

Set strLatestEvent = colMonitoredEvents.NextEvent

Wscript.Echo "A network connection has been made:"

WScript.Echo strLatestEvent.InstanceName, Now

Wscript.Echo

Loop

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新vbs学习
    热门vbs学习
    脚本专栏子分类