Solved

Getting the list of locally Installed Printers

Posted on 2007-11-20
2
835 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This seems to be a very common error related to the Samsung printer driver. First, this is the error we're talking about: Log: System Type: Error Event: 7000 Agent Time: 3:37:24 am 22-Apr-09 Event Time: 6:07:24 pm 21-Apr-09 UTC Source: Se…
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 …
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…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

707 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