local TCP/IP port creation fails

Posted on 2009-12-28
Medium Priority
Last Modified: 2012-05-08
I try to create a TCP/IP print port via a VBscript on a x64 Windows XP machine, but keep on getting an error that the port can't be created.

In the wmiprov.log file I find the following entry:
   (Mon Dec 28 14:23:29 2009.120921) : WDM call returned error: 4200
(Mon Dec 28 14:23:30 2009.121078) : ***************************************
(Mon Dec 28 14:23:30 2009.121078) : Could not get pointer to binary resource for file:
(Mon Dec 28 14:23:30 2009.121078) : C:\WINDOWS\System32\drivers\afd.sys[AfdMofResource](Mon Dec 28 14:23:30 2009.121078) :
(Mon Dec 28 14:23:30 2009.121078) : ***************************************
(Mon Dec 28 14:23:40 2009.131656) : Received Event

The VBScript used to perform the port creation is:
Set objInputFile = objFileSystem.OpenTextFile(addrFile, OPEN_FILE_FOR_READING)
pIPAddress = objInputFile.ReadLine()

' Create Printer Port
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & MyComputer & "\root\cimv2")
Set objNewPort = objWMIService.Get("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_" & pIPAddress & ""
objNewPort.Protocol = 1
objNewPort.HostAddress = "" & pIPAddress & ""
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False

The computer in question runs Windows XP Professional x64 edition SP2
and has all patches installed.
The processor is a Intel Xeon 5160 @ 3.00 GHz

Any help to resolve this is very well appreciated :)
Question by:GeertHon

Accepted Solution

GeertHon earned 0 total points
ID: 26133165
uetian1707, I checked the links but they did not resolve the problem.
The second link is even not applicable as it is a 64bit system and wbemupgd in this version doesn't know the UpgradeRepository :(

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question