I've written a script that installs several printers for a new user.
I want to change the settings on some of these so that they can print on both sides of the page.
I BELIEVE this involves modifying an attribute with printui, however it might need VB script or possibly another .NET language (I'd either use VB, C# or IronPython).
I can add a comment to a given printer, but how do I select preferences and modify them?
Pseudocode would look like this:
printui.exe /n printername /??? [how to change quality desired]
OR calls to the relevant Windows API.
You could probably do this using printui, set a printer to duplex then use printui /Ss to drop the settings into a file. Go through the various options, ie 2, 7, d... and see which file holds the duplex setting.
The other way is to use the printer api, and use either PRINTER_INFO_8 (global) or PRINTER_INFO_9 (user) structure - MSDN link. Then use the DEVMODE structure to set the dmDuplex to double sided.
First open the printer, and then close it when you're finished:
Use GetPrinter to retrieve the current printer settings, and SetPrinter to put back the modified settings:
The code to actually do this should look something like: