This post provides an example of the steps I had to take to get a 32-bit COM object registered and functionally accessible through a VBScript on an x64/AMD64 platform. The method I used to get this working was to register with the 32-bit version of regsvr32, then run the 32-bit version of cscript: This registers the prnadmin.dll using the 32-bit WOW64 edition of regsvr32, which allows access to the ActiveX control through the VBScript when run with the equivalent 32-bit WOW64 VBScript edition of cscript.exe.
In this example, I was trying to automate prnadmin function on an x64 print server, providing a simple export of local printers as a housekeeping task for reference and easy printer recovery.
Normally prnadmin.dll (Windows Resource Kit Tools) and the associated VBScripts are easy to run, copy the scripts and prnadmin.dll, regsvr32.exe prnadmin.dll and all is well. However, this was the first time I’d tried it on an x64 server, and the normal methods didn’t work.
The following errors are returned, depending on the error handling in the script:
More Information
The hardware was an Intel EM64T capable processor running the x64 edition of Windows Server 2003 R2 SP2. My understanding is that Intel Extended Memory 64-bit Technology (EM64T) is functionally equivalent to the AMD64 platform – providing an extension to the IA-32 architecture to provide 64-bit registers for the eight existing IA-32 registers, plus additional extra registers. This is parallel to the extension of 8086 8-bit to 16-bit to 32-bit to 64-bit, eg. AH/AL - AX - EAX - RAX.
Note that this is potentially quite different on true 64-bit architecture – eg. The IA64 platform – as the WOW64 subsystem running on an x64/AMD64 system does not need to perform instruction translation/emulation, merely provide a restricted virtual address space.
Wayne's World of IT (WWoIT), Copyright 2008 Wayne Martin.
Information regarding Windows Infrastructure, centred mostly around commandline automation and other useful bits of information.
1 comment:
412I tried to use the prnmngr.vbs that comes with the OS on my Windows Server 2003 Enterprise (4GB with PAE). I can only list the printers from the physical active node. (This is a two node Active-Passive Cluster) but not from the cluster.
Then I came across the win server RKT version of the tool (prnmgr.vbs), claimed it is cluster aware. But when I ran it it gave me the Object required error.
Do you think if my situation can be solved by registering the DLL as well?
Post a Comment