VBScript 监控磁盘更改事件实现代码
程序员文章站
2022-04-10 13:41:36
来自微软官方,写usb小偷脚本是最好不过的了复制代码 代码如下: strcomputer = "." set objwmiservice = getobject("winm...
来自微软官方,写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
上一篇: VBS 加解密 For CAPICOM
下一篇: VBScript根据盘符找设备名的代码