The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com



Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

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 SuSE 5 07-30-2007 08:26 AM
display full unix path as part of the command line ocelot UNIX for Dummies Questions & Answers 3 10-10-2006 02:58 PM
Display a particular line from a file Rohini Vijay Shell Programming and Scripting 5 07-31-2006 07:27 AM
Finding printers from a command prompt gseyforth Windows & DOS: Issues & Discussions 1 03-28-2006 08: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 05:41 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-22-2006
gseyforth gseyforth is offline
Registered User
  
 

Join Date: May 2002
Posts: 68
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
  #2 (permalink)  
Old 05-29-2006
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 579
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 11:13 AM..
  #3 (permalink)  
Old 06-22-2006
gseyforth gseyforth is offline
Registered User
  
 

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

Is there a way to capture the printers name as well?
  #4 (permalink)  
Old 06-28-2006
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 579
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0