Install TCP/IP Port & Printer

@ECHO OFF
REM#==========================================================================
REM #
REM # by - Ashur Guliana
REM # Description: Installs the printers & Port
REM #
REM#==========================================================================
REM # Restart the spooler service

net stop spooler
net start spooler

REM # Go to System Folder
CD:
cd\
cd C:\windows\system32

REM # INSTALLING TCP/IP PORT LOCALY

cscript prnport.vbs -a -r IP_172.16.1.1 -h 172.16.1.1 -o raw -n 9100 -me
Cscript prnport.vbs -a -r 172.16.1.1PS -h 172.16.1.1 -o raw -n 9100 -me

REM # INSTALLING PRINTER
rundll32 printui.dll,PrintUIEntry /dl /n "MYprinter" /q
rundll32 printui.dll,PrintUIEntry /dl /n "MYprinterps" /q

rundll32 printui.dll,PrintUIEntry /if /b "MYprinter" /f %windir%\inf\ntprint.inf /r "IP_172.16.1.1" /m "HP Laserjet 2100" /z
rundll32 printui.dll,PrintUIEntry /if /b "MYprinterps" /f %windir%\inf\ntprint.inf /r "172.16.1.1PS" /m "HP LaserJet 2100 Series PS" /z

REM # Remove existing printers with the same name so we don't get copy after copy

rundll32 printui.dll,PrintUIEntry /dl /n "MYprinter" /q