To find the process ID (PID) of the application, we need to run following command:
tasklist | findstr '<application/process name>
This will display all processes running on machine, where process name contains <application/process name> value. Result of above command includes PID – we will use this in next step.
Next, we run below command to find actual port number used by the process:
netstat -ano | findstr <PID>
This command lists all ports used by process.