Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Jul : How to get the IP Address of a Network Printer

www.cryer.info
Managed Newsgroup Archive

How to get the IP Address of a Network Printer

Subject:How to get the IP Address of a Network Printer
Posted by:"Lee Griffin" (lgriff..@sport.rr.com)
Date:Thu, 14 Jul 2005 11:53:39

Does anyone know how to get the IP Address of a network printer? Not the
address of the server to which it is attached, but the printer itself. For
example, suppose I have a server named "SERVER" at 192.168.1.1 and a printer
at 192.168.1.2. The printer is defined on SERVER as the printer "PRINTER" so
it's share looks something like "\SERVER\PRINTER". If there is a client
that is connected to PRINTER through the share, I'd like to be able to
determine what the IP address of PRINTER is. I can easily get the IP address
of SERVER. I tried using PRINTER as the host name to get its address but
that's not right. Another idea I had was that I might have to go through the
printer driver in a fashion similar to displaying the printer properties,
but I don't know how to do it. It obviously can be done--if you go into
Microsoft Outlook, call up the print dialog and select a network printer,
the IP address appears as the "Where:" entry. Does anyone know how to do it?

Thanks,
Lee Griffin

Replies:

www.cryer.info
Managed Newsgroup Archive