Hey all

Im trying to monitor a registry key HKEY_CURRENT_USER\Control Panel\Desktop
to find when a user is changing the wallpaper (win 2000 network).

Can someone tell me whats wrong with this script?
The script was taken from microsoft and modified to my needs.



1. can i monitor HKEY_CURRENT_USER???
2. the script is returns an error - "invalid query"


***********************************
Original script

Set wmiServices = GetObject("winmgmts:root/default")
Set wmiSink = WScript.CreateObject("WbemScripting.SWbemSink", "SINK_")

wmiServices.ExecNotificationQueryAsync wmiSink, _
"SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_LOCAL_MACHINE'
AND " & _
"KeyPath='SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion' AND
ValueName='CSDVersion'"

WScript.Echo "Listening for Registry Change Events..." & vbCrLf

While(1)
WScript.Sleep 1000
Wend

Sub SINK_OnObjectReady(wmiObject, wmiAsyncContext)
WScript.Echo "Received Registry Change Event" & vbCrLf & _
"------------------------------" & vbCrLf & _
wmiObject.GetObjectText_()
End Sub
***********************************My script

Set wmiServices = GetObject("winmgmts:root/default")
Set wmiSink = WScript.CreateObject("WbemScripting.SWbemSink", "SINK_")

wmiServices.ExecNotificationQueryAsync wmiSink, _
"SELECT * FROM RegistryValueChangeEvent WHERE Hive='HKEY_CURRENT_USER'
AND " & _
"KeyPath='Control Panel\\Desktop' AND ValueName='Wallpaper'"

WScript.Echo "Listening for Registry Change Events..." & vbCrLf

While(1)
WScript.Sleep 1000
Wend

Sub SINK_OnObjectReady(wmiObject, wmiAsyncContext)
WScript.Echo "Received Registry Change Event" & vbCrLf & _
"------------------------------" & vbCrLf & _
wmiObject.GetObjectText_()
End Sub
*********************************** Thanks,
ITman