Adding print drivers to Windows 7 or Windows 2008 (R2) using a script isn’t as easy as it was in earlier versions.
Sure, we can use 3th party products as RES Automation Manager to install printer drivers but that product has a price.
In this blog post I am going to walk through the steps necessary to install the printer drivers using a command line.
Let’s get started.
- Every driver has a name. When we have found the Name we can use this to fill in the script value.
- You can find the Name if you run the following command:
rundll32.exe printui.dll,PrintUIEntry /ii /f C:\epson374750eu\E_GF1HKP.INF
replace C:\epson374750eu\E_GF1HKP.INF with the name of your INF file.
|Click The Printer that I want isn’t listed
|Write down the name and the INF file name
- Repeat this step for each INF file.
The name is EPSON TX235 Series.
If you cannot find the information using these steps, you can always install the driver on a dummy system. After installing the driver, there is an entry created under HKLM\System\CurrentControlSet\Control\Print\Environments\*Environment*\Drivers\Version-*\*name*
I am not going to use the Epson name found above, I use an other driver for the next steps.
The script to add a printer driver is:
Cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs -a -m "Xerox Global Print Driver PCL" -i "C:\Xerox\x2UNIVL.inf"
-a is Add
-m is the Name
-i is the location of the INF file
Repeat this step for every INF file.
If you receive a Win32 error code 87 first check the the name. Again, If you cannot find the information from the INF file, you can always install the driver on a dummy system. After installing the driver, there is an entry created under HKLM\System\CurrentControlSet\Control\Print\Environments\*Environment*\Drivers\Version-*\*name*
Can’t get the solution to work? Contact me and let me do the trick.