Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install network printers in batch processing

2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to install a network printer in batch processing". The content is simple and clear. I hope it can help you solve your doubts. Let the editor lead you to study and learn the article "how to install a network printer in batch processing".

* Because there are many Windows computers in the company, using traditional manual steps to install printer drivers step by step is really too cumbersome and wasting time. Now we want to implement script installation of network printers.

@ echo on

Echo Auto to inistall print driver!!!

Color 0a

The following is the judging port of rem

Set count=0

: addreginfo

Set / a count=%count%+1

If exist printer count%.txt (set filename= printer count%.txt) else (goto eof)

For / f "tokens=2 delims==" an in ('type% filename% ^ | findstr / I "printer IP="') do set pIP=%%a

If / I "% pIP%" = = "LPT1:" goto addreginfo

If / I "% pIP%" = = "LPT2:" goto addreginfo

Rem the following is the information about adding ports in the registry

Set regpath2=HKEYLOCALMACHINE\ SYSTEM\ CurrentControlSet\ Control\ Print\ Monitors\ Standard TCP/IP Port\ Ports\ IP

Set regpath3=HKEYLOCALMACHINE\ SYSTEM\ ControlSet001\ Control\ Print\ Monitors\ Standard TCP/IP Port\ Ports\ IP

@ echo off

: addreg1

@ reg add "% regpath2%%pip%" / v "Protocol" / d "00000001" / f / t REGDWORD > nul 2 > nul

@ reg add "% regpath2%%pip%" / v "Version" / d "00000001" / f / t REGDWORD > nul 2 > nul

@ reg add "% regpath2%%pip%" / v "HostName" / d "/ f > nul 2 > nul

@ reg add "% regpath2%%pip%" / v "IPAddress" / d "% pip%" / f > nul 2 > nul

@ reg add "% regpath2%%pip%" / v "HWAddress" / d "/ f > nul 2 > nul

@ reg add "% regpath2%%pip%" / v "PortNumber" / d "9100" / f / t REGDWORD > nul 2 > nul

@ reg add "% regpath2%%pip%" / v "SNMP Community" / d "public" / f > nul 2 > nul

@ reg add "% regpath2%%pip%" / v "SNMP Enabled" / d "00000000" / f / t REGDWORD > nul 2 > nul

@ reg add "% regpath2%%pip%" / v "SNMP Index" / d "00000001" / f / t REGDWORD > nul 2 > nul

: addreg2

@ reg add "% regpath3%%pip%" / v "Protocol" / d "00000001" / f / t REGDWORD > nul 2 > nul

@ reg add "% regpath3%%pip%" / v "Version" / d "00000001" / f / t REGDWORD > nul 2 > nul

@ reg add "% regpath3%%pip%" / v "HostName" / d "/ f > nul 2 > nul

@ reg add "% regpath3%%pip%" / v "IPAddress" / d "% pip%" / f > nul 2 > nul

@ reg add "% regpath3%%pip%" / v "HWAddress" / d "/ f > nul 2 > nul

@ reg add "% regpath3%%pip%" / v "PortNumber" / d "9100" / f / t REGDWORD > nul 2 > nul

@ reg add "% regpath3%%pip%" / v "SNMP Community" / d "public" / f > nul 2 > nul

@ reg add "% regpath3%%pip%" / v "SNMP Enabled" / d "00000000" / f / t REGDWORD > nul 2 > nul

@ reg add "% regpath3%%pip%" / v "SNMP Index" / d "00000001" / f / t REGDWORD > nul 2 > nul

Goto addreginfo

: eof

Rem the following is to restart the print service to make the new port effective

: restartservice

Cls

Echo. Don't close this window, you are adding a printer. Please wait a minute.

Echo.

Echo is enabling the printer port.

Echo.

Net stop spooler > nul 2 > nul

Net start spooler > nul 2 > nul

Rundll32 printui.dll,PrintUIEntry / dl / n "TOSHIBA e-STUDIO455Series PCL6" / f "% pinf%" / r "% pIP%" / Q

Rem the following is to add a printer

Set count=0

: instprinter

Set / a count=%count%+1

If exist printer count%.txt (set filename= printer count%.txt) else (goto over)

For / f "tokens=2 delims==" an in ('type% filename% ^ | findstr "printer IP="') do set pIP=%%a

For / f "tokens=2 delims=="% an in ('type% filename% ^ | findstr "printer name ="') do set pname=%%a

For / f "tokens=2 delims=="% an in ('type% filename% ^ | findstr "printer model ="') do set pmodel=%%a

For / f "tokens=2 delims=="% an in ('type% filename% ^ | findstr "printer INF location ="') do set pinf=%%a

Echo.

Echo.

Echo.Already added, the printer information is as follows:

Echo.

Echo IP:% pIP%

Echo name:% pname%

Echo model:% pmodel%

: echo driver:% pinf%

If / I "% pIP%" = = "LPT1:" (goto ok)

If / I "% pIP%" = = "LPT2:" (goto ok) else (set pip=IP%pip%)

: ok

Rundll32 printui.dll,PrintUIEntry / if / b "pname%" / f "pinf%" / r "pIP%" / m "pmodel%"

Goto instprinter

: over

Echo.

Color 0b

Echo If you have any problems, please contact the administrator.

Pause

Exit

Echo, please press any key to exit

★ *

The contents of the network print server configuration file "Printer 1.txt":

Printer IP=172.16.9.2

Printer name = TOSHIBA e-STUDIO

Printer model = TOSHIBA e-STUDIO455Series PCL6

Printer INF location = E:\ TOSHIBA_64\ 110104_Loire_CDV210_CN_XP_VISTA_X64_PLC6\ Driver\ eS4px6.inf

The contents of the local printer configuration file "Printer 2.txt":

Printer IP=LPT1:

Printer name = local HP 3050

Printer model = HP LaserJet 3050 Series PCL 5e

Printer INF location = D:\ sysbak\ Printer\ hp3055\ Drivers\ 2K_XP_Vista\ hppcp501.inf

The above is all the contents of the article "how to install network printers in batches". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report