Home WindowsScripting Windows: Printer management from command line

Windows: Printer management from command line

by Tommy Andersen
0 comment

I figured that I would do a short article on how to do some basic printer management from cmd i Windows.

Overall there are two ways in which to manage printers from the Windows command line (batch scripts). Either using the Printer User Interface, known as PrintUI. Or by using the Windows Management Instrumentation Command or WMIC for short. Obviously using Powershell is also an option (however we wont go into that here).

PrintUI

Is a tool that’s been a part of every Windows version at least since Windows XP – and still Works fine on Windows 10. And it totally looks the same. It allows you to do a million things. You’ll need to load it via rundll32 as such:

This will give you a complete list of commands to use. You can see them all here by clicking below.

A few obviously examples of use would be to install and install a printer from a server.  This can be achieved as follows.

WMIC printer

As mentioned the beginning, you can also use WMIC. The cool thing about WMIC compaired to the alternative above, is that you can add some logic to your actions. For example by removing all network printers in one go…

One important note. This actually only removes printers which are installed as network printer – It DOES NOT remove printers which are network printers, but installed via a local TCP IP port. To remove these you need to specify them separately. This however can be achieved simply by:

Be carefull with this tough. I have personally, on more then one occasion, managed to remove all printers from a system with a wrongfully conceived WMIC one-liner . Efficient though.

You may also like

Leave a Comment