Category Archives: Howto Tutorials (EN)

Knowledge Network for Tutorials, Howto’s, Workaround, DevOps Code for Professionals.

Windows cannot connect to the printer

Connect to Printer: Windows cannot connect to the printer. Operation failed with error 0x00004005

Windows cannot connect to the printer
If the error occurs when adding a network printer. Printer connection cannot be established, then the printer driver must be added directly without using the printer setup wizard.

How to solving operation failed with error 0x00004005

  1. Click on the Start button, and choose settings.
  2. then select Devices and Printers & scanners.
  3. In the Printers window, click on the right to Print server properties, see below Related settings.
  4. choose the tap Drivers.
Windows-Logo + R

Alternatively open the old windows 7 control panel. Right click on the Start button und choose Run, or press Win+R

Windows-Logo + Run and type in control printers

Type in control printers and click OK

Quick shortcut rundll32 printui.dll,PrintUIEntry /s /t2

Windows cannot connect to the printer
Go through the steps 1 to 3, but first select any printer so that the option Print server properties becomes active.

Now drivers for the appropriate printer can be added with click to the Add button. In the wizard with choose the path to the previously downloaded and decompressed driver package. It must point to the directory in which the printer description INF file is located. Or select your printer from the device list for which Microsoft provides certified printer drivers.

How to Adding Network Printer

When using Windows printer shares on a server, errors may occur when adding a network printer on client site, because the printer setup wizard are unable to find the printer driver. The wizard looks for a driver in the InfPath registry key, in which the directory path to the printer driver should be saved.

Path to Printer Drivers in Registry InfPath

InfPath, Windows cannot connect to the printer
HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64-Drivers\Version-3

Now that the path to the printer driver is no longer valid, the path must be find in the registry of the server, here in this example it is the printer Sharp MX-C401 PCL6, which includes the path to the printer driver with the INF file in the InfPath registry key, the path shown as follows:

C:\Windows\System32\DriverStore\FileRepository\sn0emdeu.inf_amd64_284362ba62125445

The path is inserted as a value in the InfPath key which is presumably empty, require admin rights to change, run regedit.exe as administrator or temporarily grant admin rights to the user.

  If there is another printer on the client with the same driver, InfPath can copy this value and insert it by double-clicking InfPath on the printer with an invalid value or where the value is empty.

Adding Network Printer manually

Now open the windows administrative share print$ to the print server on the client, where the printer drivers of the server are located.

Windows cannot connect to the printer

i.e. \\SERVER02\print$

Under the print share the printer drivers of the installed printers are located on the print server. In our example \\SERVER02\x64\PCC printer drivers are for the Windows 64 Bit system architecture.

Find the appropriate CAB archive file which has the same driver that is file name as the file in RegistryKey InfPath, so here sn0emdeu.inf.

Windows cannot connect to the printer
\\SERVER02\print$\x64\PCC\sn0emdeu.inf_amd64_284362ba62125445.cab

Unzip the compressed CAB archive file that matches the printer from the print- share with 7-Zip. Then copy the files to the path taken from InfPath.

DriverStore FileRepository

Connecting and adding network printers is now possible as usual.

  Another simple solution is to add a new printer where by selecting LPT1 as the port, even if LPT1 does not exist, it is re-entered correctly when the path is installed in the InfPath registry key, so that the printer connection to network printers works again, the previously installed printer on LPT1 can be deleted with Device Removal.

Conclusion

This post showing how to solve when get the message, Windows cannot connect to the printer.

Windows cannot connect to the printer

Do you Trust this Printer? Windows cannot connect to the printer. Operation 0x00000006 failed

If you try adding a network printer, the error message appears “Windows cannot connect to the printer”, then may this post can help to solve this issue.

Windows cannot connect to the printer

PrintNightmare Printer Issues due to August cumulative update

Windows updates released August 10, 2021 and later will, by default, require administrative privilege to install drivers. Underlying a serious vulnerability in the Windows print spooler (CVE-2021-1678), Microsoft released a patch that was distributed through the August cumulative update. This leads to problems with printing for many users.

With the August Update, the vulnerability has been closed by requiring the installation of printer drivers via administrative rights by default. If there is a newer driver on the server than on the client, the client will attempt to update it by prompting you to enter an admin password.

In fact, the only solution is to reset the behavior back to the state it was before the August update.

Registry Changes default behavior

Microsoft provide an new registry key for this, this is the Key RestrictDriverInstallationToAdministrators with a value of 0 to allow users to install printer drivers. The key does not exist by default. Run by group policy or from script to open a command prompt as administrator and pasting as follows.

REG ADD "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint" /v RestrictDriverInstallationToAdministrators /t REG_DWORD /d 0 /f

  This measure removes protection against exploits of CVE-2021-1678. Microsoft therefore recommends this step only temporarily to avoid work interruptions.

  A reboot is not required when creating or changing this registry value.

Change behavior of Point and Print Restrictions to trusted servers via group policy

Specify trusted servers with the group policy Point-and-Print-Restrictions under Computer Configuration => Policies => Administrative Templates => Printer.

GPO Point and Print Restrictions

Restore path to printer driver in registry

Using Windows Printer Shares on a Server, it can happen when adding a network printer, it fails by the client, the reason is that the installation wizard no longer find the printer driver in the local driver store. The wizard looks for the directory path to the printer driver in the registry Key InfPath.

Restore path to printer driver in Registry Key InfPath
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3\

Now that the path to the printer driver is no longer valid, the path must be searched in the registry of the server, here in this example it is the printer Sharp MX-C401 PCL6, which saves the path to the printer driver with the INF file in the Key InfPath, the path is here as follows:

C:\Windows\System32\DriverStore\FileRepository\sn0emdeu.inf_amd64_284362ba62125445\

The path is inserted in the Key InfPath as a value, which is probably empty, where the change requires admin rights, regedit.exe run as an administrator, or temporarily grant the user admin rights.

  If there is another printer on the client with the same driver, this value can be copied by InfPath, and the printer with an invalid value, or where the value is empty, can be pasted by double-clicking InfPath.

Installing printers manually

Now open the administrative share print$ to the print server on the client, where the printer drivers of the server are located.

Share print on server02

For example, \\SERVER02\print$

Under the print$ share are the printer drivers of the installed printers on the print server. In our example at \\SERVER02\print$\x64\PCC are printer drivers for the Windows 64 bit system architecture.

Search here for the appropriate CAB archive file that has the same driver, i.e. file name, as the file in the RegistryKey InfPath,here is sn0emdeu.inf.

CAB Archive File

Unzip the compressed CAB archive file matching the printer from the print$ share with 7-Zip and copy the files to the path taken from InfPath.

DriverStore FileRepository

Connecting and adding network printers is now possible as usual.

  Another simple solution is to add a new printer installed via printer, where by selecting LPT1 as the port, even if LPT1 does not exist, it is re-entered correctly when the path is installed in the InfPath registry key, so that the printer connection to network printers works again, the previously installed printer on LPT1 can be deleted with Device Removal.

  Note. Windows Update KB5005652, released on August 10, 2021, requires administrator privileges by default to install drivers. This change has been made the default behavior to minimize risk on all Windows devices.