Solved

Getting the list of locally Installed Printers

Posted on 2007-11-20
2
829 Views
Last Modified: 2013-12-15
I want to get the list of all locally Installed Printers in all pcs pcs on the network. What are the possible solutions.
0
Comment
Question by:tsultan
  • 2
2 Comments
 
LVL 11

Expert Comment

by:bsharath
ID: 20325550
Check this script from Farhan

:: ===============
:: READ THIS FIRST
:: ===============
:: * This script require "Computers.txt" file on C: drive root from where it will read computer names.
:: * Successful run will generate "PrintersReport.txt" file on C: drive root
:: * Copy and paste following script in notepad and save it with any name having .cmd extension.

:: *** SCRIPT START ***
@Echo Off
SetLocal EnableDelayedExpansion

IF NOT EXIST C:\Computers.txt Goto ShowErr
FOR %%R IN (C:\Computers.txt) Do IF %%~zR EQU 0 Goto ShowErr
IF EXIST C:\PrintersReport.txt DEL /F /Q C:\PrintersReport.txt

FOR /F "delims=*" %%c IN ('Type C:\Computers.txt') Do (
      Echo Processing: %%c
      Echo ------------------------------------->>C:\PrintersReport.txt
      Echo Printers installed on %%c: >>C:\PrintersReport.txt
      Echo ------------------------------------->>C:\PrintersReport.txt
      SET Qry=WMIC /Node:"%%c" Printer WHERE "Default=True" GET NAME /Value ^| FIND /I "Name="
      FOR /F "Delims== Tokens=2" %%p IN ('!Qry!') Do (SET DPrinter=%%p)
      SET Qry=WMIC /Node:"%%c" Printer GET NAME /Value ^| FIND /I "Name="
      FOR /F "Delims== Tokens=2" %%p IN ('!Qry!') Do (
            IF "!DPrinter!"=="%%p" (
                  Echo %%p ^(Default^)>>C:\PrintersReport.txt) ELSE (
                  Echo %%p >>C:\PrintersReport.txt)
      )
)
Goto EndScript
:ShowErr
Echo "C:\Computers.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: Batch Script End


Does just what you want
0
 
LVL 11

Accepted Solution

by:
bsharath earned 500 total points
ID: 20325551
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you use a Brother DCP 130C or similar Brother printer, at some point you might encounter the following problem: after you change the ink cartridge, the printer displays an "ink empty" message. Sometimes you just need to follow the instructions…
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 …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
A short film showing how OnPage and Connectwise integration works.

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now