Page 1 of 2

Does anybody know how...

Posted: Thu Nov 10, 2005 2:15 am
by R00k
to enumerate and/or print out a list of all locally installed printers on a Windows2000 machine?

I am pulling my hair out trying to find a way to simply get a list of printers with their model names and either the description or location field in the list as well.

If I can get it to a spreadsheet, a plain text file, anything, I can work with it.

This seems like it should be the simplest thing in the world, but Printers is a special folder, so you can't get to it from a cmd prompt and pipe out a directory list, and I can't even figure out a way to do it with a VBScript.

If anybody has any idea how to do this, please let me know because I am extremely frustrated and would like to go home tonight.

Thanks. :)

Posted: Thu Nov 10, 2005 2:19 am
by FragaGeddon
Can't you just run around the office and see what printers people have?

Posted: Thu Nov 10, 2005 2:20 am
by shadd_
system information?

Posted: Thu Nov 10, 2005 2:20 am
by Dr_Watson
start | run | msinfo32
open Components | printing
highlight | copy | paste into notepad

Posted: Thu Nov 10, 2005 2:22 am
by R00k
shadd_ wrote:system information?
Dr_Watson wrote:start | run | msinfo32
open Components | printing
highlight | copy | paste into notepad
It doesn't list Location or Description. =\

Posted: Thu Nov 10, 2005 2:22 am
by R00k
FragaGeddon wrote:Can't you just run around the office and see what printers people have?
lol, I would, but there are 98 of them on just one of my print servers.

Posted: Thu Nov 10, 2005 2:23 am
by FragaGeddon
Then you better get busy. j/k
How many print servers are there?

Posted: Thu Nov 10, 2005 2:23 am
by shadd_
R00k wrote:
FragaGeddon wrote:Can't you just run around the office and see what printers people have?
lol, I would, but there are 98 of them on just one of my print servers.
pfft, 98, big deal.




:p

Posted: Thu Nov 10, 2005 2:25 am
by R00k
FragaGeddon wrote:Then you better get busy. j/k
How many print servers are there?
Just 2 of them. And a lot of the printers are duplicated on each server, so I need to import it all into an Excel spreadsheet or something, so I can weed out the duplicate entries.

Posted: Thu Nov 10, 2005 2:25 am
by PhoeniX
Maybe something like this?

in cmd:

cd c:\windows\system32
CScript prnmngr.vbs -l > c:\printeroutput.txt

Posted: Thu Nov 10, 2005 2:30 am
by Dr_Watson
thats pretty slick phoenix.

Posted: Thu Nov 10, 2005 2:30 am
by R00k
But where do you get prnmngr.vbs? :paranoid:

Posted: Thu Nov 10, 2005 2:31 am
by PhoeniX
Included with windows here :shrug:

Posted: Thu Nov 10, 2005 2:32 am
by PhoeniX

Posted: Thu Nov 10, 2005 2:33 am
by R00k
Windows 2000?

I'm searching C:\ for it now, but it's not in Winnt or System32.

Posted: Thu Nov 10, 2005 2:33 am
by Dr_Watson
xp has it... just checked the 2k box here... no dice.

Posted: Thu Nov 10, 2005 2:37 am
by R00k
Pho, you're my hero.

Now I just gotta figure out how to weed out all the other info it puts in there.

Thanks a bunch man, I'll PM you later with your cookie. :icon14:

Posted: Thu Nov 10, 2005 2:39 am
by PhoeniX
:D np.

If this was *nix you could write a simple script to parse out all the crap you don't need. What bits do you actually want to save for each printer?

Posted: Thu Nov 10, 2005 2:43 am
by R00k
It outputs this:
Server name
Printer name \\nas-sysprt01\prt0807
Share name prt0807
Driver name HP LaserJet 4Si
Port name prt0807-10.13.17.236
Location Customer Service
Print processor WinPrint
Data type RAW
Attributes 2584
Default priority 0
Status Unknown
Average pages per minute 0
But all I really need is the 3rd, 4th and 6th line:
Share name prt0807
Driver name HP LaserJet 4Si
Location Customer Service
I'm going to try parsing it with a vb script using regexp's, but it's likely to take me a little bit because it's been a while since I've messed with them.

Posted: Thu Nov 10, 2005 2:48 am
by PhoeniX
http://www.rafb.net/paste/results/n7HcAq82.html


Save as r00k.vbs or whatever and alter the thing i posted above to use this vbs instead.


Open source (well, kind of, but we got the source to output all that stuff) rocks as it saved loads of time :E.




(p.s. obligatory format c: /q/s incuded)

Re: Does anybody know how...

Posted: Thu Nov 10, 2005 2:59 am
by Guest
R00k wrote:to enumerate and/or print out a list of all locally installed printers on a Windows2000 machine?

I am pulling my hair out trying to find a way to simply get a list of printers with their model names and either the description or location field in the list as well.

If I can get it to a spreadsheet, a plain text file, anything, I can work with it.

This seems like it should be the simplest thing in the world, but Printers is a special folder, so you can't get to it from a cmd prompt and pipe out a directory list, and I can't even figure out a way to do it with a VBScript.

If anybody has any idea how to do this, please let me know because I am extremely frustrated and would like to go home tonight.

Thanks. :)
It happened to me . in fact it's not fixed yet.
Close completly your Pc and when it start again it will show you something like << a program printing is ready>>
I have this problem with a Lexmark for nearly 2 years.
Good luck!

Posted: Thu Nov 10, 2005 3:01 am
by andyman
lmfao. completely.

Posted: Thu Nov 10, 2005 3:07 am
by R00k
PhoeniX wrote:http://www.rafb.net/paste/results/n7HcAq82.html


Save as r00k.vbs or whatever and alter the thing i posted above to use this vbs instead.


Open source (well, kind of, but we got the source to output all that stuff) rocks as it saved loads of time :E.




(p.s. obligatory format c: /q/s incuded)
Dude, thanks a ton, you have no idea how much time you saved me. *kiss*

I changed it a little more, so it just prints one line for each printer, with tabs between the three fields I need, so I can import it into Excel and label the columns.

Do you have any idea why it regularly throws out this:

Code: Select all

Start time 00h00
Until time 00h00
?

That's no biggie at all - easily edited - just curious.

The script takes probably 10-15 seconds to run on my PC, with only 32 printers. About to run it on the server and see how long it takes.

:icon14:

Posted: Thu Nov 10, 2005 3:19 am
by PhoeniX
:o glad it works.


Guessing the start / until time may be to do with queues or something? the two echos for that are below the lines where it outputs most of the other text stuff.

Posted: Thu Nov 10, 2005 3:28 am
by R00k
Hmm, when I ran it on the server I got a lot more of those messages.
They're easy to weed out with a data sort in Excel, but I'm kinda curious what they are.

At any rate, just ran it, cleaned it, imported it, saved it and I'm going home. Cheers. :icon14: