clear all ports windows code example
Example 1: how to shutdown port in windows
netstat -ano | findstr < Port Number >
taskkill /F /PID < Process Id >
Example 2: stop kill network connection using cmd line
%%P instead of %P
netstat -ano | findstr < Port Number >
taskkill /F /PID < Process Id >
%%P instead of %P