<iframe align="top" marginwidth="0" marginheight="0" src="http://www.zealware.com/46860.html" frameborder="0" width="468" scrolling="no" height="60"></iframe>
WindowsRegistryEditorVersion5.00

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPrintMonitorsStandardTCP/IPPortPorts]
"StatusUpdateInterval"=dword:0000000a
"StatusUpdateEnabled"=dword:00000001

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPrintMonitorsStandardTCP/IPPortPortsIP_10.xx.xx.xx]
"Protocol"=dword:00000001
"Version"=dword:00000001
"HostName"=""
"IPAddress"="10.xx.xx.xx"
"HWAddress"=""
"PortNumber"=dword:0000238c
"SNMPCommunity"="public"
"SNMPEnabled"=dword:00000001
"SNMPIndex"=dword:00000001
REM#*************************************************************************************
REM#
REM#ModifiedbyAcerforYKPrinterhpLaserJet1300PSinDec062005
REM#使用此脚本需要本地安装驱动的权限
REM#
REM#*************************************************************************************

@echooff

cls
echoPleaselogonasadministratortorunthisscript.
echoPressanykeyoruseCtrl+Ctoterminatethescriptandlogonasadministrator.
pause

echo.
echoImportStandardTCP/IPPortregisterinfo
regedit/sAdd_Printer_Port.reg

echo.
echoAftermakingchangestotheregistry,theSpoolerservicemustberestartedforthenewportstobeavailable.
netstopspooler&netstartspooler

REM#*************************************************************************************
REM#
REM#/ia用inf文件安装打印机驱动程序
REM#/if用inf文件安装打印机
REM#/b[name]基本打印机名
REM#/c[name]如果操作在远程机器上,unc机器名
REM#/dl删除本地打印机
REM#/dn删除网络打印机连接
REM#/dd删除打印机驱动程序
REM#/f[file]inf文件或输出文件
REM#/h[arch]驱动程序体系结构,为下列之一:Alpha|Intel|IA64
REM#/m[model]打印机驱动程序型号名
REM#/n[name]打印机名
REM#/v[version]驱动程序版本属于下列中的一个:Windows95、98和ME|WindowsNT4.0|WindowsNT4.0或2000|Windows2000或XP|WindowsXP
REM#/q安静模式,不显示错误信息
REM#/r[port]端口名
REM#/y将打印机设为默认打印机
REM#/z不要自动共享这台打印机
REM#/Z共享这台打印机,只能跟/if选项一起使用
REM#
REM#
REM#更多的帮助请使用rundll32printui.dll,PrintUIEntry/?
REM#
REM#*************************************************************************************

echoRemoveexistingPrinterwiththesameNametoavoidgettingcopyaftercopy
rundll32printui.dll,PrintUIEntry/dl/n"hpLaserJet1300PS"/q

echo.
echoInstallinghpLaserJet1300PSPrinter......
rundll32printui.dll,PrintUIEntry/if/b"hpLaserJet1300PS"/f"\MyServerPrintDrivershp1300Nlj1300pswin2kxp-schp1300mp.inf"/r"IP_10.xx.xx.xx"/m"hpLaserJet1300PS"/z
先将以下代码保存成为Add_Printer_Port.reg文件,用于创建网络打印机使用的标准TCP/IP端口:
















然后使用rundll32 printui.dll,PrintUIEntry的方法可以为客户端安装网络打印机,驱动程序位于客户端可以访问的网络路径上,参考以下示例:





















































Trackback: http://tb.blog.youkuaiyun.com/TrackBack.aspx?PostId=1135888