Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to install a network printer

Status
Not open for further replies.

chuloprocks

Technical User
Jun 11, 2004
1
US
How can I get the network printer installed based on the network location?

For example:
I need to be able to have users logging on from the 10.76.0.0 location and install a printer \\servername\printername.

Basically I want a user to run a script to install a printer by specific location rather than the user.

I would prefer a simple dos script so I can copy and paste it.

Does any of this make sense

Thank you in advance.
 
Look at the NT resource kit utility con2prt.exe. It will let you easily add a network printer (and optionally make it the default). Basically all you'd need to do is run "con2prt /c \\server\printer" or "con2prt /cd \\server\printer".

If you can't get your hands on it, you can drive the add printer wizards from a command line, but the syntax is more complicated. To see it, run the following in a cmd shell:
"rundll32 printui.dll,PrintUIEntry /?" (case sensitive)

It gives all the options and lots of examples at the bottom.
 
What you need is to run a script that checks the users wrkstn IP address and then installs a printer based on that, the script would also need a database of sorts (Lookup table) so that it would know what printer to assign to what IP range. If the user is using a roaming profile, then this should be deleted on log off as otherwise eventually they would wind up with a lot of printers installed. If only a local profile is used, then this would not be needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top