Is there any batch or powershell command to add new printer port type using inf files.
I am able to see only below commands for adding TCP-IP and LPR ports and not port type.
rundll32 – Install printers using inf files.
Prnport.vbs – Creates, deletes, and lists standard TCP/IP printer ports, in addition to displaying and changing port configuration.
Add Add-PrinterPort
powershell command which create a local printer port, a printer port using TCP, and LPR printer ports.
Any pointers will be helpful.
Best Answer
Print monitors (aka Ports) are installed just like every other driver.
You can use the "Install" verb which is available on the right click menu. From script, you can access this via the
Shell.Application
COM Object.On Windows 8.1, that maps to the following command, but I don't believe this is documented anywhere:
On older systems (before Vista), you can also use the Windows API to install the INF via the
InstallHinfSection
function called viaRunDll
:You can also install a print monitor directly via the AddMonitor function, which you can call from Powershell.