GeertHon
asked on
local TCP/IP port creation fails
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\driver s\afd.sys[ AfdMofReso urce](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=imper sonate}!\\ " & MyComputer & "\root\cimv2")
Set objNewPort = objWMIService.Get("Win32_T CPIPPrinte rPort").Sp awnInstanc e_
objNewPort.Name = "IP_" & pIPAddress & ""
objNewPort.Protocol = 1
objNewPort.HostAddress = "" & pIPAddress & ""
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_
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 :)
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\driver
(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
pIPAddress = objInputFile.ReadLine()
' Create Printer Port
On Error Resume Next
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=imper
Set objNewPort = objWMIService.Get("Win32_T
objNewPort.Name = "IP_" & pIPAddress & ""
objNewPort.Protocol = 1
objNewPort.HostAddress = "" & pIPAddress & ""
objNewPort.PortNumber = "9100"
objNewPort.SNMPEnabled = False
objNewPort.Put_
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 :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please read the below discussions;
http://blogs.technet.com/askperf/archive/2007/10/16/wmi-troubleshooting-impersonation-rights.aspx
http://forums.techarena.in/operating-systems/1215792.htm