|
本帖最后由 yjqd 于 2019-12-11 00:16 编辑
win8pe 32位,成功运行:微软官方监控磁盘更改事件源码判断U盘插入拔出VBS脚本
所需文件总大小:33.8M左右
如果不能运行,看是否还缺少相关文件、注册表是否没相关项、环境变量是否没相关项
=======================================
至少所需文件:
system32\wbem wbem里面的文件没精简(以后再精简)
system32\cscript.exe
system32\vbscript.dll
system32\wscript.exe
=======================================
微软官方监控磁盘更改事件源码判断U盘插入拔出VBS脚本内容
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
|
|