VBScript 监控磁盘更改事件实现代码
时间:2020-11-15 13:19:45|栏目:VBS|点击: 次
来自微软官方,写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教程:属性-Line 属性
栏 目:VBS
下一篇:在vbs运行命令行工具后让命令窗口保持打开状态的脚本
本文地址:http://www.codeinn.net/misctech/22561.html