How are you creating the new Local Port?
"\\stici_sso01\BrotherH"
if you do not add the port, it cannot be set
prncnfg -t -p PRINTER -r "\\newserver\oldshare"
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
Unable to configure printer PRINTER Error 0x80041001 Generic failure
Operation PutInstance
Provider Win32 Provider
Description The specified port is unknown.
Win32 error code 1796

Signature
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/search/?adv=1
This posting is provided "AS IS" with no warranties, and confers no rights.
> Dear Friends,
>
[quoted text clipped - 27 lines]
> to
> try to figure out why it happens.
Pedro Lima - 20 Feb 2008 12:04 GMT
Alan,
Thank you for your answer to my post. I have just one more question: how can
I add a local port first ? I have seen examples on how to do it, but only on
IP ports. I have not seen redirection ports - like my case. I have tried the
command you showed in your last post, but it didn't work out. My version of
prncfg is the one that comes with Windows 2003 resource kit that is available
for download in microsoft web page.
Greatings,

Signature
Pedro Lima
> How are you creating the new Local Port?
>
[quoted text clipped - 43 lines]
> > to
> > try to figure out why it happens.
Pedro Lima - 20 Feb 2008 13:08 GMT
Guys... Mr. Alan (thanks Alan) gave me part of the solution. He pointed to me
that I had to create the port first. Then, God gave me a light to find the
rest of the solution to my problem. Since there is not an easy way to create
a port, I decided to create it directly in the registry. I share with you the
script that is working! Yes!!!
strkey = "Software\Microsoft\Windows NT\CurrentVersion\Ports"
strType = "REG_SZ"
strComputer = "."
set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colPrinters = objWMIService.ExecQuery ("Select * from Win32_Printer")
For Each objPrinter in colPrinters
If objPrinter.PortName = "\\sieci_sso01\BrotherH" Then
strValue = "\\stici_sso01\BrotherH"
call createport(strkey, strvalue, strtype)
objPrinter.PortName = strValue
objPrinter.Put_
End If
Next
Function createport(key, value, type)
Set objService = objWMIService.ExecQuery ("Select * from Win32_Service
Where Name = 'Spooler'")
For Each objService in ObjService
objService.StopService()
const HKEY_LOCAL_MACHINE=&H80000002
set regkey=GetObject("winmgmts:root\default:StdRegProv")
createkey=regkey.setstringvalue(HKEY_LOCAL_MACHINE,Key,Value,"")
set regkey=nothing
objService.StartService()
Next
End Function

Signature
Pedro Lima
> Dear Friends,
>
[quoted text clipped - 23 lines]
> reproducible in any environment, so you can see the error in your machine to
> try to figure out why it happens.