Hello,

i have wrote a script using the Win32_VolumeChangeEvent.
(Its for detecting USB Sticks mounted)

It is running fine on Windows Server 2003 but on Windows XP
there is no event Fired up?

Does anyone know about this this feature?
(Its XP SP2 ;-)

Best Regards,
Mario Fuchs

Here is the Script

-------------------------------------------------------------------------------------
Set oNetwork=CreateObject("WScript.Network")
Set oShell=CreateObject("WScript.Shell")

Set oWMI=GetObject("winmgmts:")

Set oEvents=oWMI.ExecNotificationQuery("Select * FROM
Win32_VolumeChangeEvent")

wscript.echo "monitoring volume change events."

strEventDescription="config change/arrived/removed/docked"

Do
Set oEvent=oEvents.NextEvent

Select Case oEvent.EventType
Case 1: strEventDescription="config changed"
Case 2: strEventDescription="arrived ;-)"
Case 3: strEventDescription="removed"
Case 4: strEventDescription="docked"
Case Else: strEventDescription="unknown"
End Select

strLogText=oNetwork.UserName & " Drive: " & oEvent.DriveName & " " &
strEventDescription & "."

Wscript.echo Now() & ": " & strLogText
oShell.LogEvent 8,strLogText
Loo
-------------------------------------------------------------------------------------