JSI Tip 10494. How can I list the shared printers installed on a local or remote computer?

Using RMTShare.exe, I have scripted ListPrinter.bat to report the shared printers that are installed on a specified computer.

The syntax for using ListPrinter.bat is:

ListPrinter NetBIOS_Computer_Name

Where NetBIOS_Computer_Name is the NetBIOS computer name of the 'server' whose printers you wish to enumerate.


listprinter JSI001


"\\JSI001\HP2250","HP Business Inkjet 2250 (PCL5C)"
"\\JSI001\HP2250T1","HP Business Inkjet 2250 Tray 1 (PCL5C)"
"\\JSI001\HPOffice","HP Officejet 6200 series"
ListPrinter.bat contains:
@echo off
if \{%1\}==\{\} @echo Syntax ListPrinters Computer&goto :EOF
set c1=%1
set c1=%c1:"=%
set c1=%c1:\=%
set c1=\\%c1:\=%
set b1=FIND /V ":"
set b2=FIND /V "The command completed successfully."
set b3=FIND "Path"
for /f "Skip=4 Tokens=*" %%a in ('rmtshare %c1%^|%b1%^|%b2%') do (
 set line=%%a
 if "!line:~13,1!" NEQ " " call :c1prt !line:~0,12!
goto :EOF
for /f "Tokens=1*" %%b in ('rmtshare %c1%\%1^|%b3%') do (
 set work=%%c
 set work=!work:,LocalsplOnly=!
 @echo "%c1%\%1","!work!"

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.