一起学习网 一起学习网


网络连接状态建立于断开的VBS脚本

网络编程 网络连接状态建立于断开的VBS脚本 06-22
断开连接提示

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实现监视进程创建与删除的代码
监视进程的创建,在每次创建新的进程时,临时事件消费程序都发出警报。1.监视进程的创建strComputer="."SetobjWMIService=GetObject("winmgmts:"_&"{impersonationLevel=im

用VBS实现音乐播放的多个代码小结
第一个代码,会使用默认mp3文件关联的程序,会出现音乐播放框wscript.sleep12000setws=createobject("wscript.shell")ws.run"兄弟你累了吗.mp3"第二段代码调用了WMPlayer.

Crack8 VBS整人脚本 你不说你爱我 就关机
setierunner=createobject("wscript.shell")ierunner.run"cmd/cstarthttp://www.baidu.com/",0wscript.sleep2000ierunner.sendkeys"%{F4}"onerrorresumenextdimWSHshellAsetWSHshellA=wscript.createobject("wscript


编辑:一起学习网

标签:进程,代码,音乐播放,提示,程序