I write a VBS to monitor print job.
The following script works well.
##############VBS-1####################
Set colPrintJobs = objWMIService.ExecQuery("Select * from Win32_PrintJob")
For each objPrintJob in colPrintJobs
Wscript.echo objPrintJob.caption
next
#########################################
But when I use ExecNotificationQuery to retrieve the object collection,it
throws out a running time error which tells me that object does not support
the property or method :"objPrintJob.caption".Could you tell how to monitor
print job?
##############VBS-2####################
Set colPrintJobs = objWMIService.ExecNotificationQuery("Select * from
__instancecreationevent WITHIN 1 WHERE TargetInstance ISA 'Win32_PrintJob'")
Do While True
Set objPrintJob =colPrintJobs.NextEvent()
WScript.Echo "Caption: " & objPrintJob.Caption
Loop
#########################################