Identifying a printer offline/online status for a local/network printer

Posted on 2005-03-31
Medium Priority
Last Modified: 2012-06-27
I have used PRINTER_INFO_2 structure and GetPrinter for the same. However,it always returns a status of ready even when the physical printer is powered off.
Please suggest me an idea to identify Printer online status for a line printer.
I do not want to use drWrite to check this , as it might also be a network/shared printer.
In which case,drWrite might always return offline.
Suggest me some code snippets.
Thanks in advance.
Question by:Priya_Kumar
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 38

Expert Comment

ID: 13687248
When you say local/network printer, I assume this is a printer plugged into a PC, and shared. In that case, the status is the status of the queue, which is always ready to accept jobs. If the printer is not online, the jobs are held until the printer is back.

If you have a networked printer (with a built-in network card), you can ping the printer. No reply means the printer is off or not connected.

Author Comment

ID: 13687938
Can you suggect me some code in C++ to get the status of the queue for a printer that is plugged into a PC and shared.
LVL 13

Accepted Solution

AlbertaBeef earned 0 total points
ID: 13713448
Priya, I'd suggest asking that question in one of the programming TA's, you may get better response.

If you'd like to do that, I can close this Q. for you, just let us know.

Expert Comment

ID: 13925925
The status bit in the PRINTER_INFO_2 is only updated when the print spooler attempts to write to the printer therefore if no jobs are stuck in the queue it always reports status = 0 (Ready).

Some printers allow you to query the status using a special escape sequence and others support the NMTP protocol...suggest you consult your printer manufacturer's developer documentation.  

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Printers have changed substantially in the last 30 or so years, not just in technical capabilities but in cost and usage as well.  Printers were originally used for interfacing with the operator, not necessarily for printing copy or pictures. In …
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question