Solved

Getting the list of locally Installed Printers

Posted on 2007-11-20
2
825 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
Comment Utility
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
Comment Utility
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Causes of paper jams:The following are the main causes of paper jams. Guides:If the guides for the paper are not set correctly they may cause the paper to enter at an angle. You should ensure that the guides are set correctly for the paper type a…
When I recently replaced my image transfer kit on my office HP color laserjet 5550dn printer, I had a slight problem.  The left bracket that holds the transfer kit got stuck in the upright locked position instead of being at a 45 degree angle facing…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

10 Experts available now in Live!

Get 1:1 Help Now