Install network printer for all users

cdrane

n00b
Joined
Feb 23, 2007
Messages
10
I'm trying to install a network printer for all users on a workstation. Currently we have a login.bat that is executed each time a user logs in to maps some drives. It looks like this:
net use f: /del
net use g: /del
net use h: /del
net use m: /del
net use n: /del
net use s: /del

net use f: /home
net use g: \\%servername%\vol1
net use h: \\%servername%\shared
net use n: \\%servername%\apps

copy \\%servername%\shared\hosts %windir%\system32\drivers\etc\

I want to add come code to this file to add a network printer and make it the default printer. Many of our users move around and I don't want to install a printer each time someone is at a new workstation. We are running Windows Server 2003 on our Domain Controller. Each workstation is running Windows XP. Thanks for the help.
 
This command is the basic syntax to add a server based printer from the command line / batch file:

RunDll32.exe printui.dll,PrintUIEntry /in /n \\sever\printername

Note that if your share name contains spaces, then you'll want to enclose the \\server\sharname in quotes......

To get a complete list of options for printui.dll, type the following at a command prompt:

rundll32 printui.dll,PrintUIEntry /?
 
This command is the basic syntax to add a server based printer from the command line / batch file:

RunDll32.exe printui.dll,PrintUIEntry /in /n \\sever\printername

Note that if your share name contains spaces, then you'll want to enclose the \\server\sharname in quotes......

To get a complete list of options for printui.dll, type the following at a command prompt:

rundll32 printui.dll,PrintUIEntry /?


I wish I could wipe that DLL off the face of the planet. You have to use that damn command to remove the printers or they just keep comming back. Also have issue with a non-admin user getting some drivers installed. the user is left with a non-function printer connection =\. trust me its a bad idea. I manage over 700 printers and that dll is a bad idea unless all your users are local admins and you don't having to use the dll to remove printers as well.

A better route would be a login script.

objNetwork = wscript.createobject("wscript.network")
objNetwork.AddWindowsPrinterConnection \\server\printer
objNetwork.SetDefaultPrinter \\server\printer

It adds the printer connection o na per-user basis.
 
Thanks guys. I've used the "RunDll32.exe printui.dll,PrintUIEntry /in /n \\sever\printername" command with some success but I'm having trouble making the printer the default. I'm going to try using the script presented by oakfan52. Thanks again.
 
This command is the basic syntax to add a server based printer from the command line / batch file:

RunDll32.exe printui.dll,PrintUIEntry /in /n \\sever\printername

Note that if your share name contains spaces, then you'll want to enclose the \\server\sharname in quotes......

To get a complete list of options for printui.dll, type the following at a command prompt:

rundll32 printui.dll,PrintUIEntry /?

I realize i'm digging up an old post but this script was nearly exactly what i was looking for. Except that i'm trying to create an unmanaged batch scripts that runs with no user interaction. The problem i'm having is that the computer asks is i "trust the server" and i have to put install for it to get the drivers, is there any way to force the "install drivers" option?

thanks in advance for any help.
 
I realize i'm digging up an old post but this script was nearly exactly what i was looking for. Except that i'm trying to create an unmanaged batch scripts that runs with no user interaction. The problem i'm having is that the computer asks is i "trust the server" and i have to put install for it to get the drivers, is there any way to force the "install drivers" option?

thanks in advance for any help.

Good Question.... I'd like to know as well.
 
Back
Top