Create printer of port type Standard TCP/IP

jskfan used Ask the Experts™
Create printer of port type Standard TCP/IP

The code below creates printer with port type as local Port. I need the port type to be Standard TCP/IP
Any help will be very appreciated

Thank you

@echo off
for /f %%a in (CompPrinterConf.txt) do (
	@echo starting pnpport on %%a
	cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\prnport.vbs" -a  -s %%a -r "printer1" -h hostname -o raw -n 9100
	@echo Waiting 5 seconds
	timeout 5
	@echo starting setting MyPrinter on %%a
	cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a  -p "Myprinter" -m "Generic / text only" -r "printer1" -s %%a
	REM Not really needed, because the script will continue with the next machine
	REM timeout 5


Open in new window

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Consultant
::Creating a Printer Port
cd c:\windows\system32\printing_admin_scripts\en-us\
Cscript Prnport.vbs -a -r -h

::Install Printer Driver
rundll32 printui.dll,PrintUIEntry /ia /m "EXACT NAME OF DRIVER AS WRITTEN IN .inf FILE" /f "\\server\file\.inf"

::Create Printer in System
rundll32 printui.dll,PrintUIEntry /if /b "PRINTER NAME GOES HERE" /f "\\server\file.inf" /r "" /m "EXACT NAME OF DRIVER AS WRITTEN IN .inf FILE"

Make sure you change the to what your printer's IP is. \server\file\.inf is the location of the .inf file your for your driver.

Could you refer the below links for the similar requests


Thank you ..

The Script I posted already creates Standard TCP / IP sure why I posed that script.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial