I offer this vbs script I wrote a long time ago, don't ask me for any details or support. But notice DEVICE LEFT:
================================================================
' test computer's fitness to detect DeviceChange events. Self terminates in 5 minutes.
'
Dim beginTime, endTime, elapsed
strComputer = "."
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService. _
ExecNotificationQuery( _
"Select * from Win32_VolumeChangeEvent")
WScript.Echo "Begin Test"
beginTime = Now
Do
Set objLatestEvent = colMonitoredEvents.NextEvent
'Wscript.Echo objLatestEvent.DriveName
'Wscript.Echo objLatestEvent.EventType
'Wscript.Echo objLatestEvent.Time_Created
Select Case objLatestEvent.EventType
Case 2 If ( fso.FolderExists( objLatestEvent.DriveName & "\Ipod_Control" ) ) then _
WScript.Echo "Device arrived and iPod detected as drive " & objLatestEvent.DriveName
Case 3 WScript.Echo "Device left"
End Select
endTime = Now
elapsed = Round( (endTime-beginTime)*100000,0 )
If elapsed > 360 Then WScript.Quit()
Loop until ( MsgBox("Do it again?", vbYesNo, "Test" )=7 )
================================================================