The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
Google UNIX.COM


Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
inconsistent ls command display at the command prompt & running as a cron job rajranibl Linux 5 07-30-2007 05:26 AM
display full unix path as part of the command line ocelot UNIX for Dummies Questions & Answers 3 10-10-2006 11:58 AM
Display a particular line from a file Rohini Vijay Shell Programming and Scripting 5 07-31-2006 04:27 AM
Finding printers from a command prompt gseyforth Windows & DOS: Issues & Discussions 1 03-28-2006 05:24 AM
how to concatenate two command in one line and get the display in one screen vasikaran UNIX for Dummies Questions & Answers 9 07-01-2005 02:41 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-22-2006
Registered User
 

Join Date: May 2002
Posts: 62
Display Printers via command line

Is there an easy way to view all printers on a local
machine via command line or a script?

I'm looking for the equivalent of clicking on
"START, CONTROL PANEL, PRINTERS AND FAXES"
to view the devices.

I then want to cat it to a file where I would use
it later.

Thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-28-2006
tayyabq8's Avatar
UNIX Hobbyist
 

Join Date: Nov 2004
Location: /World/Asia/MiddleEast/Kuwait/Salmiya
Posts: 525
You didn't mention the platform, I guess its Windows XP, for windows XP/NT, try this at command prompt:
Code:
c:\>cscript %systemroot%\system32\prndrvr.vbs -x
Above'll delete all unused drivers, then enter following commands, to get the desired results:
Code:
c:\>cscript %systemroot%\system32\prndrvr.vbs -l > tmp

c:\>find "Driver name" tmp > yourfile
Regards,
Tayyab

Last edited by tayyabq8; 05-29-2006 at 08:13 AM.
Reply With Quote
  #3 (permalink)  
Old 06-22-2006
Registered User
 

Join Date: May 2002
Posts: 62
Thank you, Thank you, Thank You!!!

Is there a way to capture the printers name as well?
Reply With Quote
  #4 (permalink)  
Old 06-27-2006
tayyabq8's Avatar
UNIX Hobbyist
 

Join Date: Nov 2004
Location: /World/Asia/MiddleEast/Kuwait/Salmiya
Posts: 525
What you mean by printer name? Above command is already giving you printer names only. I ran above batch and got following ouput:
Code:
---------- TMP
Driver name HP OfficeJet G95,3,Windows NT x86
Driver name HP OfficeJet G85,3,Windows NT x86
Driver name hp LaserJet 1160 PCL 5e,3,Windows NT x86
Driver name hp deskjet 940c,3,Windows NT x86
Driver name Hewlett-Packard HP-GL/2 Plotter,3,Windows NT x86
Driver name Epson LQ-680 ESC/P 2,3,Windows NT x86
Here, Driver name means printer name. Like HP OfficeJet G95 etc.

Pls explain exactly what you want.

Regards,
Tayyab
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0