|
<< Click to Display Table of Contents >> Navigation: Using UPnP Wizard > Command Line Tool |
UPnP Wizard Command Line is an optional utility that installs along with UPnP Wizard. You can find the command line version named UPnPWizardC.exe in the UPnP Wizard install directory. You can use the command line version for automated tasks in conjunction with the Windows Task Scheduler such as making sure that a port mapping is always available when Windows starts.
-add Add a new port mapping. See below for usage.
-remove Removes the specified port mapping by description or external port and protocol. See below for usage.
-list Lists all existing port mappings.
-listip Lists all available local IP addresses.
-externalip Display external IP address.
-scan Scans the network and lists all compatible UPnP devices.
-help Displays this help message.
-about Displays the about message.
-boundip Bind to a specific local IP address. Ignored in legacy mode.
-auto Automatically uses the first compatible UPnP device found on the network.
-legacy Use the legacy UPnP library.
-verbose Prints network request and response data. Ignored in legacy mode.
UPnP Wizard will default to the network interface with the highest priority as specified by Windows unless the -boundip or -auto option is specified.
Use the -boundip <IP Address> option to specify which network interface to use.
Use the -auto option to search the network for a compatible UPnP device. The first device found will be used.
-add <Description> -ip <IP Address> -intport <Internal Port> -extport <External Port> -protocol <TCP/UDP> -lease <Lease Duration>
-add <Description> -ip <IP Address> -intport <Internal Port> -extport <External Port> -protocol <TCP/UDP> -lease <Lease Duration> -boundip <IP Address>
-add <Description> -ip <IP Address> -intport <Internal Port> -extport <External Port> -protocol <TCP/UDP> -lease <Lease Duration> -auto
-add <Description> -ip <IP Address> -intport <Internal Port> -extport <External Port> -protocol <TCP/UDP> -legacy
Use the word "default" in the -ip option to use the system default IP address.
Specify the lease duration for the port mapping in seconds. 0 means the port will be opened indefinitely.
The lease duration is ignored when using the legacy option.
-remove <Description>
-remove -extport <External Port> -protocol <TCP/UDP>
To add a port mapping named "Game" with for the IP of 127.0.0.1 with an internal and external port of 8080 or the TCP protocol use:
UPnPWizardC.exe -add Game -ip 127.0.0.1 -intport 8080 -extport 8080 -protocol TCP -lease 0
Use the boundip option to specify which network interface to use.
UPnPWizardC.exe -add Game -ip 127.0.0.1 -intport 8080 -extport 8080 -protocol TCP -lease 0 -boundip 192.168.1.100
Use the auto option to find the UPnP enabled device on your network if you have multiple network interfaces.
UPnPWizardC.exe -add Game -ip 127.0.0.1 -intport 8080 -extport 8080 -protocol TCP -lease 0 -auto
Use the legacy option to use the legacy UPnP library
UPnPWizardC.exe -add Game -ip 127.0.0.1 -intport 8080 -extport 8080 -protocol TCP -lease 0 -legacy
To remove the "Game" port mapping use:
UPnPWizardC.exe -remove Game
OR
UPnPWizardC.exe -remove -extport 8080 -protocol TCP
To list all the existing port mappings use:
UPnPWizardC.exe -list
The remove and list options also supports the boundip, auto, and legacy flags.