How to make sure that a certain Port is not occupied by any other process
You can use "netstat" to check whether a port is available or not.
Use the netstat -anp | find "port number"
command to find whether a port is occupied by an another process or not. If it is occupied by an another process, it will show the process id of that process.
You have to put : before port number to get the actual output
Ex
netstat -anp | find ":8080"
netstat -ano|find ":port_no"
will give you the list.
a: Displays all connections and listening ports.
n: Displays addresses and port numbers in numerical form.
o: Displays the owning process ID associated with each connection .
example : netstat -ano | find ":1900"
This gives you the result like this.
UDP 107.109.121.196:1900 *:* 1324
UDP 127.0.0.1:1900 *:* 1324
UDP [::1]:1900 *:* 1324
UDP [fe80::8db8:d9cc:12a8:2262%13]:1900 *:* 1324
It's netstat -ano|findstr port no
Result would show process id in last column