摘要
我正在尝试自动化Windows 7 x64的脚本,以便在我创建的IPP打印机上设置“直接打印到打印机”属性(参见下面的屏幕截图)
我已经尝试过rundll32 printui.dll,PrintUIEntry /Xs /n "PrinterName" attributes +direct
建议here,但我收到错误参数无效
在打了两个星期之后,我遇到了解决方案:
PrintUIEntry有一个“未记录的开关”:/x
。这必须存在于初始打印机安装中。
映射IPP打印机需要未记录的/ x开关。 (内容ID 314486)
最终,这就是所有需要添加的东西。
rundll32 printui.dll PrintUIEntry /if /f %windir%\\inf\\ntprint.inf /r “http://localhost:<port>/” /m “<drivername>” /b ”<PrinterName>” /n “<PrinterName>” /q /Y /z /u /x
rundll32 printui.dll,PrintUIEntry /Xs /n "<PrinterName>" attributes +direct`