VBScript 监控磁盘更改事件实现代码
程序员文章站
2024-01-08 15:32:10
来自微软官方,写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