Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

batch file to add printers to windows 2000 server


  • Please log in to reply

#1
thebucs

thebucs

    Member

  • Member
  • PipPip
  • 51 posts
is there a way to write a batch file that will add local printers using a tcp/ip port and ip address of printer automatically. we use eltron and zebra printers. we have about 100-125 of them. each one has its own jet direct with its own ip address. the goal would be to have a batch file that could add these printers automatically instead of having to manually add them to each one of our 16 servers.
can any one please help? :whistling:
  • 0

Advertisements


#2
gerryf

gerryf

    Retired Staff

  • Retired Staff
  • 11,365 posts
OK, I think this will work



You need to do two things--first, create a port, second install the printer



You might want to test this with 3 printers to ensure it works before creating the whole batch file. Let's say that you have a Zebra 170PABB (made up number) with an ip address of 192.168.0.15



You need two things--first, a network port to print to and thene the actual printer. First, discover what the output protocol for your printer is--most likely RAW (but could be LPR)



Use the first line of the batch file to create the port, the second to load the printer



prnport -a -r IP_192.168.0.15 -h 192.168.0.15 -o raw

prnmgr -a -p "ZebraRm101" -m "Zebra 170PABB" -r IP_192.168.0.15




for prnpoprt

-a means ADD

-r means port name or ROUTE TO THIS PORT

-h means the ip address

-o sets the output protocol



NOTE-- IT IS A BEST PRACTICE TO NAME THE PORT NAME AND IP ADDRESS THE SAME THING--not required, but smart



for prnmgr

-a means ADD

-p means what you want the printer to display as (in my example, I used shortand to say this printer is in Room 101)

-m means the printer model--THIS MUST BE EXACT SO WINDOWS KNOWS WHAT DRIVER TO USE

-r means port name or ROUTE TO THIS PORT





I would probably add all the ports first in a batch file and then the printers, just so you are not switching back and forth between commands...will go smoother



So, your batch file woudl look something like this





prnport -a -r IP_192.168.0.15 -h 192.168.0.15 -o raw

prnport -a -r IP_192.168.0.16 -h 192.168.0.16 -o raw

prnport -a -r IP_192.168.0.17 -h 192.168.0.17 -o raw

prnport -a -r IP_192.168.0.18 -h 192.168.0.18 -o raw

...

prnmgr -a -p "ZebraRm101" -m "Zebra 170PABB" -r IP_192.168.0.15
prnmgr -a -p "ZebraRm102" -m "Zebra 170PABB" -r IP_192.168.0.16
prnmgr -a -p "ZebraRm103" -m "Zebra 170PABB" -r IP_192.168.0.17
prnmgr -a -p "ZebraRm104" -m "Zebra 170PABB" -r IP_192.168.0.18
...













This all assumes that the drivers for these printers are already included on the system
  • 0

#3
thebucs

thebucs

    Member

  • Topic Starter
  • Member
  • PipPip
  • 51 posts
ok i tried, and it did not seem to work, maybe i did something wrong.

here is what i am trying to add
port name = E211
ip = 10.0.6.211
printer name E211
driver type = HP LaserJet 4
output = Raw


here is what i tried
prnport -a -r E211 -h 10.0.6.211 -o raw

and

prnmgr -a -p E211 -m HP LaserJet 4 -r E211

these are 2 seperate batch files
did i write this corectly or did i miss something?
  • 0

#4
gerryf

gerryf

    Retired Staff

  • Retired Staff
  • 11,365 posts
put the printer and driver in " marks

prnmgr -a -p "E211" -m "HP LaserJet 4" -r E211
  • 0

#5
thebucs

thebucs

    Member

  • Topic Starter
  • Member
  • PipPip
  • 51 posts
ok i tried that one as well. but still they do not display in pinters. here is what i have

prnport -a -r E211 -h 10.0.6.211 -o raw


prnmgr -a -p "E211" -m "HP LaserJet" 4 -r E211

what do you think?
  • 0

#6
gerryf

gerryf

    Retired Staff

  • Retired Staff
  • 11,365 posts
did you do it only as a batch? try typing them from a command line and relay any errors
  • 0

#7
thebucs

thebucs

    Member

  • Topic Starter
  • Member
  • PipPip
  • 51 posts
it says prnport is not recognized as an internal or external comand, operable program or batch file.
same for prnmgr
  • 0

#8
dsenette

dsenette

    Je suis Napoléon!

  • Administrator
  • 26,019 posts
  • MVP
http://download.micr...IUsersGuide.doc
http://www.windowsit...4539/14539.html


don't know if either of those two will help...i can't personally translate most of it...but gerry you may have an idea on it
  • 0

#9
gerryf

gerryf

    Retired Staff

  • Retired Staff
  • 11,365 posts
what operating system on the clients?
  • 0

#10
thebucs

thebucs

    Member

  • Topic Starter
  • Member
  • PipPip
  • 51 posts
windows 2000 server the clients are using an in house database system to take advantage of these printers.
  • 0

Advertisements


#11
gerryf

gerryf

    Retired Staff

  • Retired Staff
  • 11,365 posts
OK, we better back up here...explain how this network is set up again?

You've got 16 or so servers, and you want to print to them from...the servers? Or the clients?

The printers are network devices? Or they are hooked up to the servers directly?
  • 0

#12
thebucs

thebucs

    Member

  • Topic Starter
  • Member
  • PipPip
  • 51 posts
ok there are 16 servers. they travel around the country ot ocnventions. with these servers are laptops a few hundred of them that also travel. on these servers the printers are set up as local printer using tcp/ip, however the jet directs that are plugged into these printers are plugged into switches. when all the equipment arrives at the convention, it is set up like any other network. the laptops use a database program that you tell it in the program which printers it will be able to print to. the printer itself is plugged into a switch. the printers are installed on the server that is at the convention. it is installed by doing the following..
add printer wizard,
next,
local printer,
next,
create a new port,
select tcp/ip as port type
when add standard tcp/ip port wizard comes up click next,
enter the ip (10.0.6.211)
enter port name (E211)
click next,
when additional port info comes up, click next,
click finish,
when the addd printer wizard comes back,
select hp from the left, and hplaserjet4 from the right,
click next,
keep existing driver,
next,
printer name (E211)
no to default
next
do not share
next
no to test page,
next,
finish

once this is done, you will see it in printers, and the database program can locate and send the info being printed to the correct jet direct and printer.

i hope this clarifies. i will be offline for a bit will return sat 3-june-06 at 0700 eastern time
thanks,
brian
  • 0

#13
gerryf

gerryf

    Retired Staff

  • Retired Staff
  • 11,365 posts
and these printer installation steps are run on the server or laptops?


I am trying to discern what is actually doing the printing?
  • 0

#14
thebucs

thebucs

    Member

  • Topic Starter
  • Member
  • PipPip
  • 51 posts
installed on the servers. the printing is done from the laptops through a database program. when you configure the laptops, you tell the database the printer name to be used (E211) then throughout the day when you print a record, it contacts the server and then prints the info to the printer. none of the print drivers are installed locally on the laptops, only servers.
  • 0

#15
gerryf

gerryf

    Retired Staff

  • Retired Staff
  • 11,365 posts
Oh....hmmm, so the laptops have some kind of automatic redirect to a printer server.....



this part:

prnport is not recognized as an internal or external comand, operable program or batch file.
same for prnmgr




I need to think about this



Do a search for prnport.vbs in c:\windows\system32



Is it there? Should be...what are the path statements in the server environment?



Open a command prompt, type



cscript

<enter>



what happens?
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP