Monitoring a printer queue from asp.net

Posted by Krishnasamy2008 under ASP.NET on 4/12/2011 | Points: 10 | Views : 1609 | Status : [Member] | Replies : 1
Hi Friends,

I did Monitoring a printer queue in my application.It works everything fine when you are enable "keep printed documents" in printer properties.The problem comes when i'm not enable "keep printed documents" in my printer properties.I'm using Win32_PrintJob in my application.Can anyone guide me some other solutions.

Thanks and Regards,
Krishna.K




Responses

Posted by: Lalji_mer on: 5/10/2011 [Member] Bronze | Points: 25

Up
0
Down
You can user Script return the number of jobs currently in each print queue on a computer.

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPrintQueues = objWMIService.ExecQuery _
("Select * from Win32_PerfFormattedData_Spooler_PrintQueue Where " & _
"Name <> '_Total'")
For Each objPrintQueue in colPrintQueues
Wscript.Echo "Name: " & objPrintQueue.Name
Wscript.Echo "Current jobs: " & objPrintQueue.Jobs
Next


LP MER

Krishnasamy2008, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response