command works after entering it 2 to 3 times

I am running this command to set the printer property to black and white and the other one is to set the printer to onesided. I have to run the command 2 to 3 times before it works. Can anyone tell me what I need to do to only have to run the command one time?


set-printConfiguration -computername xxxxxxxx -printername prnxxxx -color $false
set-printConfiguration -computername xxxxxxxx -printername prnxxxx -duplexingmode onesided

There’s a solid chance the problem is on the printer end, and unfortunately that’s probably out of anyone’s control. It certainly sounds as if it’s the printer, at least.

Hi John, there is another way to do it.

You could configure “your default” settings on a dummy printer then save those settings to a file

& RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Ss /n “printername” /a “file.dat”

You can then restore the settings to another printer like so:

& RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Sr /n “printername” /a “file.dat”

If you just want to restore the colour profile from the DAT file you could use:

& RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /Sr /n “printername” /a “file.dat” c