I'm looking for a way to automate the installation of newtwork printers. I would like to have a list of printers in a knowledge base item that the end user can click on a name and the printer will install.  We have our users move around the building alot.

I can install the printer via cmd  "rundll32 printui.dll PrintUIEntry /in /n\\server\printer"

Can i create a html doc to put in the knowledge base, with the printer name that is a 'hyperlink' of sorta that will run this cmd line?

Or even point it back to a .bat that lives on the server with that cmd line.

Thanks for the help

0 Comments   [ - ] Hide Comments


Please log in to comment

Community Chosen Answer



You could create an Online script to do it. Then create a new item in the user portal (service desk>software library) for the user to click. You can even get creative and restrict it to labels based location/user so they do not see unnecessary printers.

Answered 08/15/2013 by: dugullett
Red Belt

  • Hint: PrintUI commands to add printers fail if a printer with the same name already exists. I find it useful to preface each printui add command with one or more printui delete commands. Or you could use WMIC to query existing printers to figure out what needs to be removed, but that's more work.
Please log in to comment
Answer this question or Comment on this question for clarity



Create a cmd with a question for the user and place a shortcut on the desktop for every user.

Script could look like this:

@Echo off


Rem # Ask user for his choice.                                                    



Echo  /////////////////////////////////////////////////////////////////////////////

Echo  //                                      Add a printer                      //

Echo  /////////////////////////////////////////////////////////////////////////////


Echo  Press 1 to connect to the xxx printers

Echo          The following UK Printers will be added:

Echo          (PRT-XX1 PRTXX2)


Echo  Press 2 to connect to the xx2 printers

Echo          The following DE Printers will be added:

Echo          (PRT-XX1 PRTXX2)


Echo  Press 3 to connect to the xx3 printers

Echo          The following US Printers will be added:

Echo          (PRT-XX1 PRTXX2)


Echo  Press 4 to connect to the xx4 printers

Echo          (PRT-XX1 PRTXX2)


Echo  Press E for EXIT

Echo          Nothing will be done and this window will close.



Choice /C 1234E /M "What's your choice?"


If %errorlevel% == 0 Goto Question

If %errorlevel% == 1 Goto UK

If %errorlevel% == 2 Goto DE

If %errorlevel% == 3 Goto US

If %errorlevel% == 4 Goto ESP

If %errorlevel% == 5 Goto End

If %errorlevel% == 255 Goto Question

Rem # Connect to UK Printers                                                     

rundll32 printui.dll PrintUIEntry /in /n\\server\printer



Rem # Connect to DE Printers                                                     

rundll32 printui.dll PrintUIEntry /in /n\\server\printer



Rem # Connect to US Printers                                                     

rundll32 printui.dll PrintUIEntry /in /n\\server\printer



Rem # Exit the Script                                                            

Answered 08/16/2013 by: tecrumors
Sixth Degree Black Belt

  • The Software library as a script is the best method. If you do this as a KB article the user would need local admin rights.
Please log in to comment