來自微軟官方,寫USB小偷腳本是最好不過的了
復制代碼 代碼如下:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!" & strComputer & "rootcimv2")
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