佳能打印機(jī)LBP6650安裝腳本
18:44 2013-12-17 by依山居
網(wǎng)絡(luò)打印機(jī)安裝腳本瘫辩,可以實(shí)現(xiàn)一鍵安裝打印機(jī),安裝速度更快更方便坛悉。批量安裝或者自動(dòng)安裝伐厌,效率提高很明顯。
已知腳本適用于佳能打印機(jī)LBP6650DN LBP6650N
需要管理員權(quán)限裸影,已知適用于WIN XP挣轨,可以直接用在WIN 7上,但不推薦轩猩,WIN 7的注冊(cè)表項(xiàng)有一點(diǎn)不一樣卷扮。
下載到打印機(jī)驅(qū)動(dòng)GUFRII_Driver_V200_W32_ZH
并把腳本復(fù)制到目錄中編輯。
LBP6650DN 的注冊(cè)表文件和安裝腳本:
XP.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPrintMonitorsStandard TCP/IP PortPorts]
"StatusUpdateInterval"=dword:0000000a
"StatusUpdateEnabled"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Monitors\Standard TCP/IP Port\Ports\IP_192.168.18.86]
"Protocol"=dword:00000001
"Version"=dword:00000001
"HostName"=""
"IPAddress"="192.168.18.86"
"HWAddress"=""
"PortNumber"=dword:0000238c
"SNMP Community"="public"
"SNMP Enabled"=dword:00000001
"SNMP Index"=dword:00000001
LBP6650DN.cmd
@echo off
title 安裝打印機(jī)佳能LBP6650打印機(jī)
color 17
setlocal enabledelayedexpansion
mode con cols=52 lines=35
cd /d %~dp0
cls
net stop spooler & net start spooler
reg import XP.reg
rundll32 printui.dll,PrintUIEntry /if /b "86佳能LBP6650DN" /f %~dp0\Driver\CNLB0C.INF /r "IP_192.168.18.86" /m "Canon Generic UFR II Driver" /z
LBP6650N 的安裝腳本也是一樣的均践,這里省略了晤锹。
我這里是 LBP6650DN LBP6650N 兩臺(tái)打印機(jī)都要安裝,所以安裝腳本合并一下,就可以一次性給電腦安裝上這兩臺(tái)打印機(jī) :
@echo off
title 安裝打印機(jī)佳能LBP6650打印機(jī)
color 17
setlocal enabledelayedexpansion
mode con cols=52 lines=35
cd /d %~dp0
::pause
cls
::net stop spooler & net start spooler 重啟一下打印機(jī)服務(wù)彤委,可以減少安裝失敗的情況鞭铆。
net stop spooler & net start spooler
reg import XP.reg
rundll32 printui.dll,PrintUIEntry /if /b "86佳能LBP6650DN" /f %~dp0\Driver\CNLB0C.INF /r "IP_192.168.18.86" /m "Canon Generic UFR II Driver" /z
ping 127.0.0.1>nul
::net stop spooler & net start spooler 重啟一下打印機(jī)服務(wù),可以減少安裝失敗的情況焦影。
net stop spooler & net start spooler
reg import 87XP.reg
rundll32 printui.dll,PrintUIEntry /if /b "87佳能LBP6650N" /f %~dp0\Driver\CNLB0C.INF /r "IP_192.168.18.87" /m "Canon Generic UFR II Driver" /z
::設(shè)置默認(rèn)打印機(jī)
rundll32 printui.dll,PrintUIEntry /n "86佳能LBP6650DN" /y
pause
實(shí)際使用當(dāng)中车遂,會(huì)有安裝失敗的情況,所以腳本當(dāng)中加了重啟打印機(jī)服務(wù)的命令減少這種情況斯辰,如仍安裝失敗舶担,重啟電腦再安裝。
360之類的防護(hù)軟件會(huì)自動(dòng)攔截腳本彬呻,需要手動(dòng)允許腳本繼續(xù)執(zhí)行安裝衣陶。
參考資料:
讓普通權(quán)限的用戶執(zhí)行安裝腳本:
http://www.2cto.com/os/201009/72403.html
rundll32 printui.dll,PrintUIEntry
http://technet.microsoft.com/zh-cn/library/ee624057