Skip to main content
SysAdmin

Install and Add Network Printers from the command line

By April 8, 2023No Comments

You can install network printers from the command line or with a batch file without the need of local admin access.  This way users can, for example, install a local network printer on their laptop when they are on a remote site.  This will work from Win 7 upwards to 10 and you don’t need to install anything. The scripts that are used are installed by default in C:\Windows\System32\Printing_Admin_Scripts.

There are 3 steps to take to install a printer. Try to use as many general drivers as possible to ease up the installation.

If you want to use PowerShell, then make sure you check out this post

Step 1 – Install the driver

1.  cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\prndrvr.vbs" -a -m "<Printer Driver Name>" -h "<Path to INF File>" -i "<"INF File>"

Look inside the INF file to get the correct driver name that is used.

Step 2 – Add the printer port

1.  Cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\Prnport.vbs" -a -r <Port Name> -h <Printer IP Address> -o raw
2.
3.  REM For example:
4.  Cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\Prnport.vbs" -a -r 192.168.20.200 -h 192.168.20.200 -o raw -n 9100

Step 3 – Add the printer

1.  cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs" -a -p "<Printer Name>" -m "<Printer Driver Name from Step 1>" -r "<Printer Port Name from Step 2>"
2.
3.  REM For example
4.  Cscript "C:\Windows\System32\Printing_Admin_Scripts\en-US\Prnmngr.vbs" -a -p "Canon_Test" -m "Canon PLC6 Class Driver" -r 192.168.20.1