Summary
I'm trying to automate a script for Windows 7 x64 to set the "Print directly to the printer" attribute on an IPP Printer I've created (see screenshot below)
I've tried rundll32 printui.dll,PrintUIEntry /Xs /n "PrinterName" attributes +direct
as suggested here, but I get the error The arguments are invalid
After beating my head against this for 2 weeks, I came across the solution:
PrintUIEntry has an "undocumented switch": /x
. This must be present for the initial printer installation.
An undocumented /x switch is required to map an IPP printer. (Content ID 314486)
Ultimately, that's all that needed to be added.
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`