错误“访问打印机‘打印机名’的设置无效"从 Windows 服务打印时 [英] Error "Settings to access printer 'printername' are not valid" when printing from Windows service

查看:152
本文介绍了错误“访问打印机‘打印机名’的设置无效"从 Windows 服务打印时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在打印到网络打印机时遇到了提到的错误.

I get the error mentioned when printing to a network printer.

在XP/Win2003下运行、在WinForm应用程序中或使用本地打印机时不会出现此错误.

The error does not occur when run under XP/Win2003, in a WinForm app or when a local printer is used.

只有在 Vista/Win7/Win2008 下作为 Windows 服务运行并打印到网络打印机时才会出现此错误.

The error does only occur when run as a Windows Service under Vista/Win7/Win2008 and printing to a network printer.

Windows 服务在有权访问网络打印机的网络用户下运行.在打印之前,我通过循环访问可用的打印机来检查打印机名称(包括网络路径)是否正常.

The Windows service runs under a network user that has access to the network printer. Before I print I check if the printername (including network path) is ok by looping through the available printers.

如何解决?

推荐答案

通过 Microsoft 文档中所述的注册表黑客将打印机添加到 SYSTEM 用户来解决:http://support.microsoft.com/kb/184291/en-us.

Solved by adding the printer to the SYSTEM user via a registry hack as described in the Microsoft doc: http://support.microsoft.com/kb/184291/en-us.

这篇关于错误“访问打印机‘打印机名’的设置无效"从 Windows 服务打印时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆