how to restart process on certain port code example Example: close all localhost connections netstat -ano | findstr :yourPortNumber taskkill /PID typeyourPIDhere /F