Does anybody know how...

Open discussion about any topic, as long as you abide by the rules of course!
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Does anybody know how...

Post 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. :)
User avatar
FragaGeddon
Posts: 3229
Joined: Sun Sep 17, 2000 7:00 am

Post by FragaGeddon »

Can't you just run around the office and see what printers people have?
shadd_
Posts: 2512
Joined: Tue Jun 28, 2005 4:02 pm

Post by shadd_ »

system information?
[size=75]i never meant to give you mushrooms girl[/size]
Dr_Watson
Posts: 5237
Joined: Wed Feb 23, 2000 8:00 am

Post by Dr_Watson »

start | run | msinfo32
open Components | printing
highlight | copy | paste into notepad
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post 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. =\
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post 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.
User avatar
FragaGeddon
Posts: 3229
Joined: Sun Sep 17, 2000 7:00 am

Post by FragaGeddon »

Then you better get busy. j/k
How many print servers are there?
Last edited by FragaGeddon on Thu Nov 10, 2005 2:24 am, edited 1 time in total.
shadd_
Posts: 2512
Joined: Tue Jun 28, 2005 4:02 pm

Post 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
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post 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.
User avatar
PhoeniX
Posts: 4067
Joined: Fri Aug 04, 2000 7:00 am

Post by PhoeniX »

Maybe something like this?

in cmd:

cd c:\windows\system32
CScript prnmngr.vbs -l > c:\printeroutput.txt
Dr_Watson
Posts: 5237
Joined: Wed Feb 23, 2000 8:00 am

Post by Dr_Watson »

thats pretty slick phoenix.
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post by R00k »

But where do you get prnmngr.vbs? :paranoid:
User avatar
PhoeniX
Posts: 4067
Joined: Fri Aug 04, 2000 7:00 am

Post by PhoeniX »

Included with windows here :shrug:
User avatar
PhoeniX
Posts: 4067
Joined: Fri Aug 04, 2000 7:00 am

Post by PhoeniX »

R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post by R00k »

Windows 2000?

I'm searching C:\ for it now, but it's not in Winnt or System32.
Dr_Watson
Posts: 5237
Joined: Wed Feb 23, 2000 8:00 am

Post by Dr_Watson »

xp has it... just checked the 2k box here... no dice.
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post 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:
User avatar
PhoeniX
Posts: 4067
Joined: Fri Aug 04, 2000 7:00 am

Post 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?
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post 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.
User avatar
PhoeniX
Posts: 4067
Joined: Fri Aug 04, 2000 7:00 am

Post 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)
Guest

Re: Does anybody know how...

Post 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!
andyman
Posts: 11198
Joined: Wed Feb 09, 2005 8:20 pm

Post by andyman »

lmfao. completely.
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post 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:
User avatar
PhoeniX
Posts: 4067
Joined: Fri Aug 04, 2000 7:00 am

Post 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.
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post 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:
Post Reply