2012-08-07

使用batch指令來新增網路印表機[TCP/IP模式]

【TCP/IP方式的網路印表機】
參考網址:http://www.linuxreaders.com/2010/10/installing-printer-from-command-line-windows.html

@echo off
rem "Printer Automation"
rem "Created by Vidyadhar"
rem "Mapping the network drive"
cd \
net use v: /DELETE
net use v: \\192.168.1.2\printer\

rem "Creating TCP/IP port"
cd \
cscript %windir%\system32\prnport.vbs -d -r IP_192.168.1.10
cscript %windir%\system32\prnport.vbs -a -r IP_192.168.1.10 -o raw -n 9100 -h 192.168.1.10

rem "Installing Printer's Driver"
cscript %windir%\system32\prndrvr.vbs -a -m "HP LaserJet P2015 Series PCL 6" -h "V:\\2015\\" -i "V:\\2015\\hppcp604.inf"

rem "Installing Printer"
cscript %windir%\system32\prnmngr.vbs -a -p "HP_Printer" -m "HP LaserJet P2015 Series PCL 6" -r "IP_192.168.1.10"

rem "Making it Default printer"
cscript %windir%\system32\prnmngr.vbs -p "HP_Printer" -t

rem "Deleting mapped drive"
net use v: /DELETE

沒有留言: