Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Contact
  • Reviews
  • Toggle search form
Home » Windows » How to add Print Drivers with PowerShell, RUNDLL32, and VBScript in Windows 10
  • UEFI vs BIOS What's the Difference
    What are the Differences between UEFI and BIOS Windows
  • How to Fix Windows 11 File Explorer lags and freezes issue
    How to Fix Windows 11 File Explorer Lags and Freezes Issue Windows
  • Wingettool
    Install and Manage Applications with Winget Windows
  • Veeam Agent Error Fix
    Fixing AIX Veeam agent job startup delay issue Network | Monitoring
  • linkyourandriodtoyourpc
    Microsoft Phone Link: Connect Android to Windows 11 Windows
  • Featured image batch rename
    Batch rename multiple files on Windows Windows
  • How to Decrypt Files and Folders Encrypted with EFS in Windows 10
    How to decrypt Files and Folders Encrypted with an Encryption File System (EFS) in Windows Windows
  • Telegram
    Integrate a WordPress site with WP Telegram Network | Monitoring

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.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to 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

  • win10 usb
    How to prevent installation of removable devices Windows
  • Windows 10 logo wmskill.com
    Handy Shutdown commands available in Windows Windows
  • WCD
    Join Bulk Devices using a Provisioning Package to Azure AWS/Azure/OpenShift
  • Featured image
    How to use the voice input instead of typing on Windows Windows
  • Laptop battery performance report
    Windows Battery Report: Track down a malfunctioning laptop battery Windows
  • image 130
    How to fix the Security Database on the Server does not have a Computer Account for this Workstation Trust Relationship on Windows Server [Part 2] Scripts

More Related Articles

win10 usb How to prevent installation of removable devices Windows
Windows 10 logo wmskill.com Handy Shutdown commands available in Windows Windows
WCD Join Bulk Devices using a Provisioning Package to Azure AWS/Azure/OpenShift
Featured image How to use the voice input instead of typing on Windows Windows
Laptop battery performance report Windows Battery Report: Track down a malfunctioning laptop battery Windows
image 130 How to fix the Security Database on the Server does not have a Computer Account for this Workstation Trust Relationship on Windows Server [Part 2] Scripts

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

sysadmin top30a

  • UEFI vs BIOS What's the Difference
    What are the Differences between UEFI and BIOS Windows
  • How to Fix Windows 11 File Explorer lags and freezes issue
    How to Fix Windows 11 File Explorer Lags and Freezes Issue Windows
  • Wingettool
    Install and Manage Applications with Winget Windows
  • Veeam Agent Error Fix
    Fixing AIX Veeam agent job startup delay issue Network | Monitoring
  • linkyourandriodtoyourpc
    Microsoft Phone Link: Connect Android to Windows 11 Windows
  • Featured image batch rename
    Batch rename multiple files on Windows Windows
  • How to Decrypt Files and Folders Encrypted with EFS in Windows 10
    How to decrypt Files and Folders Encrypted with an Encryption File System (EFS) in Windows Windows
  • Telegram
    Integrate a WordPress site with WP Telegram Network | Monitoring

Subscribe to Blog via Email

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

Join 1,839 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

AWS 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.