Solved

Getting the list of locally Installed Printers

Posted on 2007-11-20
2
834 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
[X]
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
  • 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

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best way to share an MFP laser printer? 5 115
HP FutureSmart 1 120
disable USB on Dell Printers 14 41
Enforcing the Duplex printing and B&W for all employee ? 9 40
How to solve seemingly unsolvable printer issues. Users sometimes run into printing issues where all the normal steps do not seem to work. Well the steps below can show users how to take one extra step beyond the normal steps needed to remove old…
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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
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…

726 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