首页 > 编程 > VBScript > 正文

VBScript 监控磁盘更改事件实现代码

2020-07-26 11:48:06
字体:
来源:转载
供稿:网友

来自微软官方,写USB小偷脚本是最好不过的了

复制代码 代码如下:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!//" & strComputer & "/root/cimv2")
Set colMonitoredEvents = objWMIService. _
ExecNotificationQuery("Select * from Win32_VolumeChangeEvent")
Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Wscript.Echo objLatestEvent.DriveName
Wscript.Echo objLatestEvent.EventType
Wscript.Echo objLatestEvent.Time_Created
Loop

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表