local TCP/IP port creation fails

Posted on 2009-12-28
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
    LVL 32

    Expert Comment

    by:Kamran Arshad

    Accepted Solution

    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

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Network ports are the threads that hold network communication together. They are an essential part of networking that can be easily ignore or misunderstood, my goals is to show those who don't have a strong network foundation how network ports opera…
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now