https://community.spiceworks.com/scripts/show/828-add-default-network-printer
新增 VBscript 放到 DC 的 NetLogon 目錄
Option Explicit ' Suppress errors on error resume next ' Declare Variables Dim objPrinter, printerPath ' Path to printer (Add your information below) printerPath = "\\yourserver\printername" Set objPrinter = CreateObject("WScript.Network") ' Add printer objPrinter.AddWindowsPrinterConnection printerPath ' Add as default objPrinter.SetDefaultPrinter printerPath wscript.sleep 500 WScript.Quit
(以下是用 batch file 的方式)
http://blog.yam.com/vincent2219/article/28706086
Changing printer settings from a script
新增網路印表機
rundll32 printui.dll,PrintUIEntry /in /q /n "\\SERVER\printer"
設定為預設印表機
rundll32 printui.dll,PrintUIEntry /y /q /n "\\SERVER\printer"
刪除網路印表機
rundll32 printui.dll,PrintUIEntry /dn /q /n "\\SERVER\printer"
如果要改變印表機的設定,例如是 paper size,可以先找一台電腦把印表機設定好並調整設定,然後把印表機設定存成檔案,再用復原的方式回存到其他電腦。
Save:
rundll32 printui.dll,PrintUIEntry /Ss /n "\\SERVER\printer" /a "c:\tmp\file.dat" u
Restore:
rundll32 printui.dll,PrintUIEntry /Sr /n "\\SERVER\printer" /a "c:\tmp\file.dat" u
沒有留言:
張貼留言