XeroxプリンタドライバのLPRポートサイレントインストール
- プリンタドライバファイルを展開しフォルダに収納する. INFファイルの中に Model sections 項目があるのでドライバ名を確認する.
- OSの言語は %WINDIR%\System32\Printing_Admin_Scripts にある
- LPRポートの定義とその設定は, その言語フォルダの下にある prnport.vbs が行う.
- ドライバのインストールは, rundll32 printui.dll,PrintUIEntry /if /b プリンタの名称 /f ドライバを展開したフォルダ\INFファイル.inf /r prnport.vbsで設定したポート名 /m "INFファイル中のプリンタドライバ名" /u /z
- rundll32 printui.dll,PrintUIEntry /dl /n プリンタ名 /q は, 既に存在しているプリンタの削除.
- rundll32 printui.dll,PrintUIEntry /dd /n "プリンタドライバ名" /q は, 既に存在しているドライバの削除.
@echo off cd /d %~dp0 for /f "usebackq" %%i in (`dir /b %WINDIR%\System32\Printing_Admin_Scripts\`) do set lng=%%i set pport=%WINDIR%\System32\Printing_Admin_Scripts\%lng%\prnport.vbs rundll32 printui.dll,PrintUIEntry /dl /n Printer-Name /q rundll32 printui.dll,PrintUIEntry /dd /m "Printer Driver Name" /q cscript %pport% -d -r lpr-port cscript %pport% -a -h IP-ADDR -r lpr-port -o lpr -me -y public -i 1 -q lp rundll32 printui.dll,PrintUIEntry /if /b Printer-Name /f Driver-Folder\INFfile.inf /r lpr-port /m "Printer Driver Name" /u /z
- cd /d %~dp0 は %0 で表されるバッチファイルのフルパスファイル名のうち, ドライブレターとパスを抜き出してディレクトリを変更すること. ドライブの変更 /d は対応していないOSがある.
- http://technet.microsoft.com/ja-jp/library/cc754352%28v=ws.10%29.aspx
- http://technet.microsoft.com/ja-jp/library/ee624057%28v=ws.10%29.aspx
- http://www.admintech.jp/wiki.cgi?page=rundll32.exe+printui.dll+PrintUIEntry+%A4%CE%BB%C8%A4%A4%CA%FD