Windows 7 Printers & 0x8007007E (The specified module could not be found) …

So here’s the scenario:

(1) A Windows Server 2003 (x86) print server

(2) A bunch of HP printers using HP’s universal driver — specifically, the PCL5 driver. All printers are connected to the aforementioned server via the network.

(3) A bunch of Windows 7 Pro x64 clients with the aforementioned PCL5 driver installed.

Problem:

Printers (on x64 clients) won’t map — the client machines can’t connect to the HP printers on the server. You may get various error messages/symptoms; I discovered this problem when a domain login script wouldn’t map printers. Here’s a simplified example of what the script might look like:

Set objNetwork = CreateObject(‘WScript.Network’)
objNetwork.AddWindowsPrinterConnection ‘\\server\\printer’

Whenever the domain login script ran, the following error would appear:

The error message reads:

Error: The specified module could not be found.
Code: 8007007E
Source: (null)

You may also get an error with the following code:

Error: Cannot connect to printer
Code: 0000007E

What causes this?

When the 32 bit universal driver is installed on the server, a registry key is created:

HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\<printer name>\CopyFiles\BIDI

This key exists to tell the client that it needs to copy a dll file to in order for the printer to work on the client machine. The problem is that the path points to the 32 bit version of the driver (which makes sense, because the print server is a 32 bit machine). The 64 bit clients need the 64 bit version of the driver — which you’ve already installed on the client machines (you did install it… right?) Whenever the 64 bit client tries to load this 32 bit module, the above error(s) is(/are) the result; additionally, you’ll see the following error in the Event Viewer:

printer-error-that-causes-vbs-error

As it turns out, this is a very easy problem to fix; just delete the BIDI key. The client machines will no longer be told that they need to copy the wrong file and they’ll connect just fine. But what about 32 bit clients? Well I haven’t noticed any ill-effects from deleting the key but I’d imagine that the worst that can happen is that you might have to install the PCL 5 driver on the 32 bit clients rather than having the server do it whenever a client attempts to connect to a shared printer. As I said though, I haven’t noticed any problems yet and 32 bit machines are on their way out anyway. Hopefully this post saves someone else some time.

Further Reading:

http://social.technet.microsoft.com/Forums/en-US/winserverprint/thread/44ca5958-4588-4710-b231-a4a5ebdb3611/

http://www.lewisroberts.com/2011/09/08/windows-cannot-connect-to-the-printer-0x0000007e/

http://helpforsure.wordpress.com/tag/copyfilesbidimodule/