Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Windows » How to add Print Drivers with PowerShell, RUNDLL32, and VBScript in Windows 10

How to add Print Drivers with PowerShell, RUNDLL32, and VBScript in Windows 10

Posted on 06/12/202018/04/2024 Christian By Christian 2 Comments on How to add Print Drivers with PowerShell, RUNDLL32, and VBScript in Windows 10
add Print Drivers

This article discusses ‘Add Print Drivers with PowerShell and RUNDLL32 and VBScript”. A Printer Driver is a software that your device uses to communicate with a printer on your network. The network printer does not need to have a physical connection to the network and they require an IP address or Simple Network Management Protocol (SNMP) built into CUPS to be discovered. Please see how to determine the version and type of a Printer Driver (Printer Driver Information) and how to specify a persistent default printer via the Windows Registry.

CUPS is a standard-based open-source printing system developed by Apple Inc. for macOS and other UNIX like operating systems. Here are some articles relating to Print Drivers I have written; how to delete obsolete drivers from the Driver Store in Windows 10, how to rename a Printer in Windows 10,

To add a printer driver, kindly follow any of the methods discussed below. There are other methods to have drivers installed on Windows 10 and we will be discussing them subsequencly in the future. In this article, I will be using the followng; 
- PowerShell, 
- RUNDLL32and and
- VbScript (PRNDRVR)

This article will be grouped into Part-1 (Drivers present in the Driver Store)

Part 1 – (Drivers Preset in the Driver Store)

It is possible to add printer drivers to the Windows driver store (Prestaging). Adding a driver to the Windows driver store does not install the printer driver. It merely adds the printer driver source files to the operating systems for future use such as when connecting to a Printer or having it automatically install during a Plug and Play operation

Method 1 – VBS Scripts to Manage Printers in Windows

These scripts are present in all Windows versions (starting from Vista and Windows Server 2008) and are located in the directory C:\Windows\System32\Printing_Admin_Scripts\en-US.

PowerShell
The following VBS scripts are located in this folder:
 - Prncnfg.vbs – a script to display information about the printer settings;
 - Prndrvr.vbs – printer driver management (install / uninstall printer drivers);
 - Prnjobs.vbs – managing print jobs;
 - Prnmngr.vbs – managing printers (including creating and removing printer in the system);
 - Prnport.vbs – managing connection to the remote printer via TCP/IP ports;
 - Prnqctl.vbs – print queue management;
 - Pubprn.vbs – managing printer publishing in Active Directory - (obsolete)   

Furthermore, Here is an example how to install a printer driver from the Windows driver store using the VBScript prnddrvr.vbs.

cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "HP Type4 Class Driver" -v 3 -e "Windows x64" -i "C:\Windows\inf\ntprint.inf"
RUNDLL32

Method 2

Here is an example how to install a printer driver from the Windows driver store using the RUNDLL32.exe.

RUNDLL32 PRINTUI.DLL,PrintUIEntry /ia /f "C:\Windows\inf\ntprint.inf" /m "HP Type4 Class Driver"

Part 2

Drivers are not present in the driver store but in a file repository. This command can be used also from the MDT.

Method 1 – VBS Scripts to Manage Printers in Windows (Prndrvr.vbs)

cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "PCL6_V4_Driver" -v 3 -e "Windows x64" -i "G:\Driver\PCL6_V4_Driver\ntprint.inf"
Parameters
 - a: This parameter tells the VBScript to install the driver
 - m:  The name of the driver you want to install
 - v3: The version of the driver
 - e: Specifies the The environment, i.e, the architecture of the operating system
 - i “path” – the full path to the driver’s INF file. 

Method 2 – Using RUNDLL32.exe

You can also manage Printers Drivers in different versions of Windows via the process rundll32.exe. This receives the name of the library printui.dll and the entry point to it (PrintUIEntry).

The command rundll32 printui.dll, PrintUIEntry is enough to perform basic operations with printers and is fully supported by Microsoft. One of the many DLLs that can be loaded is the printui.dll. For more information on how to add printers with no user interaction see this article.

UNDLL32 PRINTUI.DLL,PrintUIEntry /ia /f "G:\Driver\HP Driver\oemsetup.inf" /m "HP Printer Driver"
Parameters
 1: PRINTUI.DLL: This DLL file contains all the functions required to install the printer driver.
 2: /ia: This parameter lets the printui.dll know that a printer driver, using a INF file
 3: /f: The complete path and file name of the INF file of the driver. 
 4: /m: The name of the driver you want to install 

Method 3 – PowerShell:

In this session, we will be discussing the various PowerShell commands needed to install, manage, and remove printers, print ports, drivers, and queues using PowerShell. Before proceeding, I will like to discuss some key Pint management cmdlets.

Print Management Module: Below is the cmdlets needed to reveal all the print-server management cmdlets.

Here is a list of print, driver, and print queue management cmdlets available in the PrintManagement module on Windows 10. More information on the Print Management Module can be found at this how to delete obsolete drivers from the Driver Store in Windows.

Get-Command –Module PrintManagement
VBScript

A: Installing a Print Driver available in the Driver Store

You may have to list the print drivers that are installed in the Windows driver store as shown below. Just to be sure it has not been added previously.

Like I said before, there are different ways to go about this. Since we are only discussing how to do this using PowerShell, we will stick to PowerShell only.

Get-PrinterDriver

Note: You can only install a driver with the .inf file only if it is already in the DriverStore. You will notice that it is impossible to install using the” Add-PrinterDriver” command to install a driver that is not available in the system driver storage.

Now, let us install the Print Driver by using the cmdlet below since it is available in the DriverStore .

Add-PrinterDriver -Name "HP Universal Printing" -InfPath "C:\Desktop\HP-Driversx64\hpxxxx.inf"

B: Installing a Print Driver not available in the River Store:

If the driver is unavailable in the Drive Store. Kindly use the following steps to add and install your Printer Driver to your device using PowerShell. Add the Printer driver to the Driver Store.

You can only install the printer driver if they are imported to the driver store. This can be achieved with the built-in Windows “pnputil utility”.

Use the add the install switch to the PNPUTIL command to have it installed. To have it installed automatically. We need to add the /i switch and this command can also be executed directly from the MDT task sequence as well “pnputil.exe /a /i G:\Repository Directory\MyINFFile.INF”.

pnputil.exe -i -a C:\RepositoryDirectory\xxxxxxx.inf 
This (installs the specific printer driver) or 
pnputil.exe -i -a C:\RepositoryDirectory*.inf 
This installs all the drivers found in the INF files in the specified directory)

Note the following below: The /reboot switch can also add this if it is needed to complete the operation. Laos, starting with Windows Vista, the Plug and Play (PnP) manager performs driver signature verification during device and driver installation. However, the PnP manager can successfully verify a digital signature only if the following statements are true

I hope you found this blog post on how to add Print Drivers with PowerShell, RUNDLL32, and VBScript in Windows 10 helpful. If you have any questions, please let me know in the comment session.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Windows Tags:Printer, Printer Management, Printing, Windows 10

Post navigation

Previous Post: How to specify a persistent default printer via the Windows Registry and PowerShell
Next Post: How to remove a Printer from Windows 10 via PowerShell, Windows registry and Print Management

Related Posts

  • Remote Desktop Connection Windows 10 min
    Fix Remote Desktop Connection issues (Error 0x204) Windows
  • maxresdefault
    Error 0x8007232B: Can’t activate Windows on this device as we can’t connect to your organization’s activation server Windows
  • wds
    What are the differences between Lite-Touch and Zero-Touch installation? Windows
  • Capture 12
    How to Generate SSH Keys in Windows 10 Windows
  • banner 2
    How to Configure NIC Teaming on Windows Server Network | Monitoring
  • Feature post
    Disable Bing Search in Windows: Quick Guide for Windows Windows

More Related Articles

Remote Desktop Connection Windows 10 min Fix Remote Desktop Connection issues (Error 0x204) Windows
maxresdefault Error 0x8007232B: Can’t activate Windows on this device as we can’t connect to your organization’s activation server Windows
wds What are the differences between Lite-Touch and Zero-Touch installation? Windows
Capture 12 How to Generate SSH Keys in Windows 10 Windows
banner 2 How to Configure NIC Teaming on Windows Server Network | Monitoring
Feature post Disable Bing Search in Windows: Quick Guide for Windows Windows

Comments (2) on “How to add Print Drivers with PowerShell, RUNDLL32, and VBScript in Windows 10”

  1. Avatar photo Sys Admin says:
    13/08/2021 at 2:39 PM

    Fantastic, thank-you !

    Log in to Reply
    1. chris Christian says:
      13/08/2021 at 2:40 PM

      You are welcome

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

Veeam Vanguard

  • TZ
    TFTP Image to Flash: Copying Guide for Cisco ASA Network | Monitoring
  • KMS server setup
    How to set up and configure the Key Management System (KMS) Windows Server
  • Synology 1
    Synology NAS brute-force attack: Employ Synology Best Practice to remediate StealthWorker Botnet attack Security | Vulnerability Scans and Assessment
  • Featured image
    Latest Improvement to File Explorer on Windows 11 Windows
  • How to configure Azure container register with secured connection with container apps
    Configure Azure Container Registry for a secure connection with Azure Container Apps AWS/Azure/OpenShift
  • How to Delete Quick Heal Anti virus cfrbackup folder or other Anti virus on Windows
    How to Delete Quick Heal Anti-virus cfrbackup folder Anti-Virus Solution
  • unnamed
    Upgrade ManageEngine Password Manager Pro Password Manager
  • microsoft edge
    How to forcefully remove Microsoft Edge Browser the hard way from your Windows device Windows

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,819 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.