close
cscript C:\WINDOWS\system32\prnport.vbs -a -r IP_192.168.2.2 -h 192.168.2.2 -o raw -n 9100

rundll32 printui.dll,PrintUIEntry /if /b "HP LaserJet 4250 PCL 6" /f d:\4250\hpc4x50c.inf /r "IP_192.168.2.2" /m "HP LaserJet 4250 PCL 6"

這裏是rundll32 printui.dll,PrintUIEntry 的用法

使用方式: rundll32 printui.dll,PrintUIEntry [options] [@commandfile]
/a[file] 二進位檔案名稱
/b[name] 基本印表機名稱
/c[name] 如果動作發生在遠端電腦,則是電腦的 UNC 名稱
/dl 刪除本機印表機
/dn 刪除網路印表機連線
/dd 刪除印表機驅動程式
/e 顯示列印喜好設定
/f[file] 可以是 inf 檔案或輸出檔案
/ga 增加每台電腦的印表機連線
/ge 列舉每台電腦的印表機連線
/gd 刪除每台電腦的印表機連線
/h[arch] 下列驅動程式架構之一,Alpha | Intel | IA64 | x64
/ia 使用 inf 檔來安裝印表機驅動程式
/id 用新增印表機驅動程式精靈來新增印表機驅動程式
/if 使用 inf 檔來安裝印表機
/ii 啟動新增印表機精靈及 inf 檔來安裝印表機
/il 使用新增印表機精靈來安裝印表機
/in 新增網路印表機連線
/j[provider] 列印提供者名稱
/k 列印測試頁到指定的印表機。安裝印表機時,不可和命令相結合。
/l[path] 印表機驅動程式來源路徑
/m[model] 印表機驅動程式機型名稱
/n[name] 電腦名稱
/o 顯示印表機佇列檢視
/p 顯示印表機內容
/q 安靜模式,不顯示錯誤訊息
/r[連接埠] 連接埠名稱
/s 顯示伺服器內容
/Ss 將印表機設定值儲存到檔案
/Sr 將印表機設定值從檔案還原
儲存或還原必須放在命令結尾的印表機設定值選項旗標:
2 PRINTER_INFO_2
7 PRINTER_INFO_7
c 色彩設定檔
d 印表機資料
s 安全性描述元
g 通用 DevMode
m 最小設定值
u 使用者 DevMode
r 解決名稱衝突
f 強制名稱
p 解決連接埠
/u 如果已經安裝了,使用現存的印表機驅動程式
/t[#] 基本索引頁從零開始
/v[verison] 指定以下驅動程式版本之一,Windows 95、98 或 Me | Windows NT 4.0 | Windows NT 4.0 或 2000 | Windows

2000 或 XP| Windows XP
/w 如果在 inf 檔內找不到指定的驅動程式,提示一個驅動程式給使用者
/y 設成預設的印表機
/Xg 取得印表機設定值
/Xs 指定印表機設定值
/z 不自動共用這個印表機
/Y 不要自動產生印表機名稱
/K 變更 /v 和 /h 意義來接受 0、1、2、3,分別代表 Windows x64 和 Windows IA64 | Windows NT x86 | Windows NT

Alpha_AXP | Windows 4.0
/Z 共用這個印表機,只能和 /if 選項配合使用
/? 說明訊息
@[file] 命令列引數檔案
/Mw[message] 在執行命令之前先顯示警告訊息
/Mq[message] 在執行命令之前先顯示確認訊息
/W[flags] 指定精靈 (如 APW 和 APDW) 的旗幟和參數
r 讓精靈可以從上一頁重新開始
/G[flags] 指定通用旗幟和參數
w 抑制安裝驅動程式警告使用者介面出現 (極安靜模式)

範例:
執行伺服器內容:
rundll32 printui .dll ,PrintUIEntry /s /t1 /n\\machine
執行印表機內容:
rundll32 printui .dll ,PrintUIEntry /p /n\\machine\printer
在本機執行新增印表機精靈:
rundll32 printui .dll ,PrintUIEntry /il
執行新增印表機精靈於 \\machine:
rundll32 printui.dll,PrintUIEntry /il /c\\machine
執行佇列檢視:
rundll32 printui .dll ,PrintUIEntry /o /n\\machine\printer
執行 inf 檔安裝:
rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /f %windir%\inf\ntprint.inf /r "lpt1:" /m "AGFA-AccuSet

v52.3"
使用 inf 檔執行新增印表機精靈:
rundll32 printui.dll,PrintUIEntry /ii /f %windir%\inf\ntprint.inf
新增每台電腦印表機連線:
rundll32 printui.dll,PrintUIEntry /ga /c\\machine /n\\machine\printer /j"LanMan Print Services"
刪除每台電腦的印表機連線:
rundll32 printui.dll,PrintUIEntry /gd /c\\machine /n\\machine\printer
列舉每台電腦的印表機連線:
rundll32 printui.dll,PrintUIEntry /ge /c\\machine
使用 inf 檔新增印表機驅動程式:
rundll32 printui.dll,PrintUIEntry /ia /c\\machine /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000 或 XP" /f

%windir%\inf\ntprint.inf
使用 inf 來新增印表機驅動程式:
rundll32 printui.dll,PrintUIEntry /ia /K /c\\machine /m "AGFA-AccuSet v52.3" /h "Windows NT x86" /v 3
移除印表機驅動程式:
rundll32 printui.dll,PrintUIEntry /dd /c\\machine /m "AGFA-AccuSet v52.3" /h "Intel" /v "Windows 2000 或 XP"
移除印表機驅動程式:
rundll32 printui.dll,PrintUIEntry /dd /K /c\\machine /m "AGFA-AccuSet v52.3" /h "Windows NT x86" /v 3
設成預設的印表機:
rundll32 printui.dll,PrintUIEntry /y
設定印表機註解:
rundll32 printui.dll,PrintUIEntry /Xs /n "printer" comment "My Cool Printer"
取得印表機設定值:
rundll32 printui.dll,PrintUIEntry /Xg /n "printer"
取得印表機設定值並將結果儲存在檔案:
rundll32 printui.dll,PrintUIEntry /f "results.txt" /Xg /n "printer"
設定印表機設定值命令使用方式
rundll32 printui.dll,PrintUIEntry /Xs /n "printer" ?
將所有印表機設定值存放到檔案:
rundll32 printui.dll,PrintUIEntry /Ss /n "printer" /a "file.dat"
從檔案還原所有的印表機設定值:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat"
將印表機資訊存放到等級 2 的檔案中:
rundll32 printui.dll,PrintUIEntry /Ss /n "printer" /a "file.dat" 2
還原檔案印表機安全性描述元:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" s
還原檔案印表機通用 devmode 及印表機資料:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" g d
還原檔案最小設定值及解析連接埠名稱:
rundll32 printui.dll,PrintUIEntry /Sr /n "printer" /a "file.dat" m p
arrow
arrow
    全站熱搜

    bubble727 發表在 痞客邦 留言(0) 人氣()