Question

  Asked: May 18 2008   11:07 AM GMT
  Asked by: Atul net 2005


Printer Problem how can i transfer the queue to the second printer


Printer management, Printers

I am using two printers. This time 50 commands in queue, at the same time this printer getting some problem and unable to Print.

The question is " how can i transfer the queue to the second printer" Both printers are installed on print server

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Hello,
you can do this with Visual Basic Scripting with the following code:



Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colPrintJobs = objWMIService.ExecQuery("Select * from Win32_PrintJob")
For Each objPrintJob in colPrintJobs
intTotalJobs = intTotalJobs + 1
Next
If intTotalJobs > 50 Then
Call MoveQueue
End If


Sub MoveQueue
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set objPrinter = objWMIService.Get("Win32_Printer.DeviceID='ArtDepartmentPrinter'")
objPrinter.PortName = "IP_192.168.1.10"
objPrinter.Put
End Sub


The initial part checks the printer queues (you can limit the search by adjusting the query to meet you printer name) and counts the total jobs, if it is > than 50 it calls the subroutine that moves the jobs to "ArtDepartmentPrinter" queue.

I Hope this helps.

P.S. I suggest you downloading TechNet Script Center Sample Scripts
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Microsoft Windows.

Looking for relevant Microsoft Windows Whitepapers? Visit the SearchEnterpriseDesktop.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register