How to remove or add printers using commands

Our client just built a new printer server. They would like to remove old printers from each workstation and add the printers from the new printer server. There are different ways to do so, for example group policy and run command lines. This article shows you how to remove or add printers using commands (rundll32 printui.dll PrintUIEntry) or created batch file to remove or add multiple printers.

Step 1: Find the printer server name and printer name

Option 1: if you know the printer server name, use net view command.

1. Open Command Prompt by typing cmd in the search bar.

2. Use net view to check the printer name

Option 2: If you don’t know the server name, use wmic printer list brief command

Option 3: You can also use PowerShell command; Get-Printer | Format-Table

Step 2: Remove a printer or printers using rundll32

To delete a printer uses this command rundll32 printui.dll PrintUIEntry /dn /n \\server1\printername, for example

rundll32 printui.dll,PrintUIEntry /dn /n \\hsamgmtsvr02\Color-SHARP-6070N

Step 3: Add a printer or printers using rundll32

To add a printer uses this command rundll32 printui.dll PrintUIEntry /in /n \\server1\printername, for example

rundll32 printui.dll PrintUIEntry /in /n \\hsaprinter04\Color-SHARP-6070N

Step 4: If you want to remove or add multiple printers, create a batch file, for example printer.bat as showed below

rundll32 printui.dll,PrintUIEntry /dn /n \\hsamgmtsvr02\Color-SHARP-6070N

rundll32 printui.dll,PrintUIEntry /dn /n \\HSAMGMTSVR02\SHARP-MX-5071N

rundll32 printui.dll,PrintUIEntry /dn /n \\HSAMGMTSVR02\SHARP-M1055-MailRoom

rundll32 printui.dll PrintUIEntry /in /n \\hsaprinter04\Color-SHARP-6070N

rundll32 printui.dll PrintUIEntry /in /n \\hsaprinter04\SHARP-MX-5071N

rundll32 printui.dll PrintUIEntry /in /n \\hsaprinter04\SHARP-M1055-MailRoom

Step 5: Run wmic printer list brief command to confirm adding

Please view this step by step video:

Published by

Bob Lin

Bob Lin, Chicagotech-MVP, MCSE & CNE Data recovery, Windows OS Recovery, Networking, and Computer Troubleshooting on http://www.ChicagoTech.net How to Install and Configure Windows, VMware, Virtualization and Cisco on http://www.HowToNetworking.com