windows 如何以编程方式设置打印机属性?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2879458/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:30:03  来源:igfitidea点击:

How to set the printer properties programatically?

windowsscriptingprinting

提问by panzerschreck

As a paper saving drive throughout the organization, we plan to set 2 page printing (back to back) as default setting on all the Windows machines. Is it possible to program this in .NET / Java (or any scripting language)? Can we change printer properties by a program?

作为整个组织的纸张节省驱动力,我们计划将 2 页打印(背对背)设置为所有 Windows 机器上的默认设置。是否可以在 .NET/Java(或任何脚本语言)中进行编程?我们可以通过程序更改打印机属性吗?

Thanks for your time.

谢谢你的时间。

采纳答案by Jay

Can be done with WMI using VBScript or Powershell.

可以通过使用 VBScript 或 Powershell 的 WMI 完成。

Here is a blog post with lots of info to get started (including duplexing info): http://blogs.technet.com/print/archive/2009/10/16/printer-management-using-powershell.aspx

这是一篇包含大量入门信息(包括双面打印信息)的博客文章:http: //blogs.technet.com/print/archive/2009/10/16/printer-management-using-powershell.aspx