Can I Change Default Printer Settings Via The Command Line?

Dell / Inspiron one 2320
July 15, 2017 at 05:13:26
Specs: Windows 7, 3.3 GHz / 4001 MB
My company has set the default for all of our printer drivers to "Print In Grayscale".

This forces us to change the Printer Properties for almost every print job and eliminates the ability to Right-Click/Print color PDF's, etc. This will supposedly save money on toner, regardless of the fact that it costs money in time and paper when employees forget to uncheck the box before printing out a 30 page document.

We cannot add printers or change most default settings on our systems. We most certainly do not have admin rights to our systems. In addition, every Friday night (at a minimum) our systems are remotely rebooted, refreshed, etc.

Does anyone know of a "global work-around" to alter the printer driver, even if if it has to be done after every log in? Perhaps a command line entry or something like that? We do have access to the command window via cmd, but we can only do things that don't require admin rights.

Any suggestions would be most welcome.

message edited by DerbyDad03

See More: Can I Change Default Printer Settings Via The Command Line?

Reply ↓  Report •

July 15, 2017 at 05:56:37
Have a look at this for some ideas:

Reply ↓  Report •

July 15, 2017 at 10:32:32

Since this all new to me, I have a few questions:

I understand that this line saves the current printer settings to a file.

rundll32 printui.dll PrintUIEntry /Ss /n "\\network\printer" /a "C:\prefered_location\temp_settings.dat" u

1 - re: prefered_location

Am I correct in assuming that this is just a generic term that I am supposed to replace with a specific location of my choosing?

2 - re: "\\network\printer"

Is that just a generic term that I am supposed to replace with a specific printer name?

3 - re: The php code

I don't have a clue how to use php. Can I simply enter the following instruction on the command line?

All I did was replace the /Ss with /Sr

rundll32 printui.dll PrintUIEntry /Sr /n "\\network\printer" /a "C:\location\temp_settings.dat" u

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Reply ↓  Report •

July 15, 2017 at 11:07:58
Yes, those are bother generic names that you would replace with your own values.

To run the PHP code you would need to install PHP on your computer. (Google for a Windows version.) Save the code to a file (say printer.php), then you would type:

php printer.php

to run the script.

Reply ↓  Report •

Related Solutions

July 15, 2017 at 15:45:35
re: "you would need to install PHP "

That ain't gonna happen ;-)

No rights to install anything, no way to hook up external media, most sites that even hint at offering downloads are blocked.

I'm not even sure the command line instruction will work, but that's the only option that I can try.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Reply ↓  Report •

July 15, 2017 at 20:20:56
The only way this could fly is if the printer host, or server, gave "manage printer" and/or "manage documents" permissions to "everyone", which seems highly doubtful considering the security climate in which you are embedded (judging by your comments above). Not entirely anal, either, considering if one user could change defaults, and other users assumed different defaults and didn't check all their check-boxes, then "havoc would reign in the hardcopy domain". If it were my company, I would simply have two printers: one for gray-scale and one for color, with defaults set accordingly, or better: two instances of the same printer, with one set to gray-default, and the other to color. Then you could change your local default to whichever one you used the most. Of course, that is a "management issue" not something readily effected.

message edited by nbrane

Reply ↓  Report •

July 19, 2017 at 03:57:43
We do have 2 printers, B&W and Color. According to "management" (of a global company, thousands of printers) the employees have not honored their request to use the B&W printers when color is not required.

I can't argue with them, but the issue is that 99%+ of the documents that a major segment of the employees need to print must be in color. It's obviously easier to just click the print icon (for our default printer) every time instead of pausing and saying "This can be in gray scale, so I need to use the long path to printing so I can change my printer for this 1 out of 100 jobs." Now we have to use an even longer path to uncheck the Print In Gray Scale button for 99 out of 100 jobs.

They supposedly tested this set-up in a couple of locations and received what they called a favorable response so they made it global configuration. For most of the people I work with, it's a PITA and way less efficient. My guess is that the people they tested it on either do not print as much as we do or print mostly gray scale docs.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Reply ↓  Report •

July 21, 2017 at 06:03:37
Not sure if this will work but its a suggestion.

All printer settings are stored in the register as binary values with a key.

If you were to setup your printer the way you want it the export that key as a .reg file.

In theory you can either double click and install the key (providing you have permissions for this)
Run the .reg file from batch, vbs, vba


You can use vba, vbs, batch (cannot help with this)

to delete the key from registry and create a new key saving your binary data to it.

I have done some registry read/write work in vba before, i'll give it a go, but it all depends on weather you have the permission to read/write to registry?

Reply ↓  Report •

July 21, 2017 at 11:53:41
My thoughts:
- Depending on the company, it might do to go up the chain of command, bypassing whoever's enforcing this setup. Speaking of just the GP changes, assuming they've configured everything correctly, you're looking at less than an hour of work, sans whatever paperwork/approvals are needed.

- It depends on how they're doing the setting, but you might be able to enforce your config by first making your changes from Devices and Printers, then using regedit to play with the security of HKEY_CURRENT_USER\Printers\DevModePerUser. I'd suggest denying everyone from the set value and delete actions.

EDIT: If you have access to PowerShell, this should add the security blocking on the key in question:

$acl = Get-Acl HKCU:\Printers\DevModePerUser
$acl.SetSecurityDescriptorSddlForm($acl.GetSecurityDescriptorSddlForm('Access') + '(D;;DCSD;;;WD)')
Set-Acl -Path $acl.Path -Acl $acl

How To Ask Questions The Smart Way

message edited by Razor2.3

Reply ↓  Report •

July 21, 2017 at 13:16:44
Thats the key i was also talking about DevMode

there are a few options, powershell im not too familiar with but vbs or vba i can offer a solution sometime next week, only if its possible for you to make changes to registry

Reply ↓  Report •

July 21, 2017 at 13:53:19
You can always make changes to HKCU. That's kinda the point of HKCU, which is why heavily locked down systems block regedit.exe. It's also why almost every GP setting that can be applied to the user (HKCU) and the computer (HKLM) gives priority to the computer's setting.

How To Ask Questions The Smart Way

Reply ↓  Report •

July 21, 2017 at 14:22:53

Thank you i didnt realise that.

Reply ↓  Report •

Ask Question