Glam Prestige Journal

Bright entertainment trends with youth appeal.

How can I ping (from command prompt) a printer without knowing it's IP. How can I find the printer IP in the command prompt?

4

4 Answers

If you have the printer mapped on the Windows PC, there are various powershell or WMI commands to run:

get-wmiobject win32_printer | select name
get-wmiobject win32_tcpipprinterport | select hostaddress

Depending on your printer and drivers, this may not have the IP address and you'll have to query WMI.

wmic printer get DriverName, Name, Portname 

If it's an HP laser network printer, you may be connecting to port 9100, and netstat will show active network connections from powershell:

netstat -an | grep 9100
2

Most of the network printers uses IPv4. Open command prompt and run,ipconfig to know your IP address, then check your address resolution protocols to see connected devices by running arp -a on command prompt window. If you are still in doubt download nmap from here and scan your network.

1

You could run a batch file to loop through the addresses, ping each for half a second and move on. That should work fine as long as you only have one or a couple of subnets. If your network is very complicated it may take a very long time. Here's a sample script:

setlocal enabledelayedexpansion
set /a counter=0
:start
set /a counter+=1
ping -n 1 192.168.0.!counter! > devices.txt
if %counter%=255 goto finish
goto start
:finish
1

If your command line is PowerShell:

If the printer port is a TCPIPPrinterPort you can use this command:

Get-WmiObject Win32_TCPIPPrinterPort

And get the host address.

If the printer port is a WSD Port, you can check each item of:

HKLM:\SYSTEM\CurrentControlSet\Enum\SWD\DAFWSDProvider\

to retrieve the IP address.
Here at GitHUB is a script to do this.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy