In most examples, the adding process is set to "true" and not to "false".
Plus not all routers support UPnP through Windows's COM objects.
So if anything, it should be like this:
$port = InputBox("Portnumber to forward to this pc", "Port:")
$oRouter = ObjCreate("HNetCfg.NATUPnP")
$oPortList = $oRouter.StaticPortMappingCollection
if isobj($oportlist) Then
$oPortList.Add($port, "TCP", $port, @IPAddress1, True, "")
$oPortList.Add($port, "UDP", $port, @IPAddress1, True, "")
Else
MsgBox(16, "Error", "Could not create a UPnP object")
endif
Which brings us to the real final question: does anyone have a solution to the "else" cases? In other words, does anyone have a code to enable ports in such routers using SOAP (without using external third parties)? This may help.