中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

批處理如何安裝網絡打印機

發布時間:2021-10-29 10:40:18 來源:億速云 閱讀:199 作者:小新 欄目:系統運維

這篇文章主要為大家展示了“批處理如何安裝網絡打印機”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“批處理如何安裝網絡打印機”這篇文章吧。

*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

rem 以下是判斷端口
set count=0
:addreginfo
set /a count=%count%+1
if exist 打印機%count%.txt (set filename=打印機%count%.txt) else (goto eof)
for /f "tokens=2 delims==" %%a in ('type %filename% ^|findstr /I "打印機IP="') do set pIP=%%a

if /I "%pIP%"=="LPT1:" goto addreginfo
if /I "%pIP%"=="LPT2:" goto addreginfo

rem 以下是添加端口在注冊表中的信息
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 以下是重新啟動打印服務,使新端口生效
:restartservice
cls
echo.           Don`t close this window, you are adding a printer. Please wait a minute.

echo.
echo 正在啟用打印機端口...
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 以下是添加打印機
set count=0
:instprinter
set /a count=%count%+1
if exist 打印機%count%.txt (set filename=打印機%count%.txt) else (goto over)

for /f "tokens=2 delims==" %%a in ('type %filename% ^|findstr "打印機IP="') do set pIP=%%a
for /f "tokens=2 delims==" %%a in ('type %filename% ^|findstr "打印機名稱="') do set pname=%%a
for /f "tokens=2 delims==" %%a in ('type %filename% ^|findstr "打印機型號="') do set pmodel=%%a
for /f "tokens=2 delims==" %%a in ('type %filename% ^|findstr "打印機INF位置="') do set pinf=%%a
echo.

echo.
echo.Already added, the printer information is as follows:
echo.
echo  IP  :%pIP%
echo 名稱 :%pname%
echo 型號 :%pmodel%
:echo 驅動 :%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 請按任意鍵退出
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ *


網絡打印服務器配置文件“打印機1.txt”的內容:

打印機IP=172.16.9.2
打印機名稱=TOSHIBA e-STUDIO
打印機型號=TOSHIBA e-STUDIO455Series PCL6
打印機INF位置=E:\TOSHIBA_64\110104_Loire_CDV210_CN_XP_VISTA_X64_PLC6\Driver\eS4px6.inf

本地打印機配置文件“打印機2.txt”的內容:
打印機IP=LPT1:
打印機名稱=本地HP 3050
打印機型號=HP LaserJet 3050 Series PCL 5e
打印機INF位置=D:\sysbak\打印機\hp3055\Drivers\2K_XP_Vista\hppcp501.inf

以上是“批處理如何安裝網絡打印機”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

南城县| 景泰县| 西吉县| 泰兴市| 资溪县| 新干县| 佛学| 泸定县| 即墨市| 兴城市| 桑日县| 新干县| 云龙县| 额尔古纳市| 芮城县| 江北区| 裕民县| 读书| 漾濞| 张家口市| 南昌市| 华容县| 茂名市| 田阳县| 新宁县| 龙海市| 伊春市| 东丰县| 阳城县| 新营市| 扎囊县| 临安市| 阿瓦提县| 东方市| 奉贤区| 塘沽区| 达日县| 常山县| 株洲市| 阿勒泰市| 临邑县|