Create printer of port type Standard TCP/IP

jskfan
jskfan used Ask the Experts™
on
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
setlocal
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

Comment
Watch Question

Do more with

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

::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 "000.000.000.000" /m "EXACT NAME OF DRIVER AS WRITTEN IN .inf FILE"

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

Also,
Could you refer the below links for the similar requests

https://www.experts-exchange.com/questions/21449268/How-to-create-a-TCP-IP-printer-port-via-command-line.html

Author

Commented:
Thank you ..

The Script I posted already creates Standard TCP / IP Port...now 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