Обучение
Модул
Manage drivers and device peripherals - Training
This module introduces device drivers. Student will learn how drivers work and the tools used to manage common peripheral devices such as printers.
Този браузър вече не се поддържа.
Надстройте до Microsoft Edge, за да се възползвате от най-новите функции, актуализации на защитата и техническа поддръжка.
This article helps you resolve the problem that a COM object sends output to a printer fails when called from Active Server Pages.
Original product version: Active Server Pages
Original KB number: 184291
A COM object that sends output to a printer fails when called from Active Server Pages (ASP) but functions correctly when called from an interactive application. This COM object could be either a commercial product such as a Microsoft Office application, or a custom third-party object. A common error message is "ClassName error '800a01e2' Printer error."
The standard APIs that most objects use to print depend on registry entries located in HKEY_CURRENT_USER. This registry hive is dynamic. Depending on which user context the process is running under, different information will be loaded into this hive. ASP pages run under IIS, which is running as the SYSTEM account. When you create an instance of a COM object in your ASP code, by default, it will also run as the SYSTEM account. By default, the SYSTEM account does not have any printers set up in the registry.
You can set up printers for the SYSTEM account to resolve this problem. To set up printers for the SYSTEM account, perform the following steps:
Предупреждение
This method requires you to modify the registry using the Registry Editor. Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.
Ensure that the user you are currently logged into on the server has the wanted printers installed.
Launch the Registry Editor (Regedit.exe).
Select the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices
From the Registry menu, select Export Registry File.
In the File Name text box, type c:\Devices.reg.
Select the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts
From the Registry menu, select Export Registry File.
In the File Name text box, type c:\PrinterPorts.reg.
Select the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
From the Registry menu, select Export Registry File.
In the File Name text box, type c:\Windows.reg.
From the Start button, select Run. Open Devices.reg in Notepad by typing Notepad Devices.reg in Run dialog box.
Replace the text HKEY_CURRENT_USER
with HKEY_USERS\.DEFAULT
.
Save the file. Then import it into the registry by double-clicking the file in Windows Explorer.
Repeat steps 13 through 15 for PrinterPorts.reg and Windows.reg.
Бележка
These steps only work for local printers.
To enable IIS to enumerate the network printers by using the SYSTEM account, follow these steps.
Бележка
If the process is running under the Network Service account, explicit permissions to the newly created registry are required.
Make sure that you're currently logged in to the server as a user who has the wanted network printers installed.
Start Registry Editor.
Select the following key:
HKEY_CURRENT_USER\Printers\Connections
On the Registry menu, select Export Registry File.
In the File Name box, type c:\printconns.reg.
To open the printconns.reg file in Notepad, select Start, select Run, type Notepad printconns.reg in the Open box, and then select OK.
Replace the text HKEY_CURRENT_USER
with the text HKEY_USERS\.DEFAULT
.
Save the file.
To import the file into the registry, double-click the file in Windows Explorer.
Restart the Print Spooler service.
Обучение
Модул
Manage drivers and device peripherals - Training
This module introduces device drivers. Student will learn how drivers work and the tools used to manage common peripheral devices such as printers.