In Windows 10, you can close a running port using the Command Prompt or PowerShell.
- Press Win + X on your keyboard and select "Command Prompt (Admin)" or "Windows PowerShell (Admin)" from the menu. This will open the Command Prompt or PowerShell with administrator privileges.
- In the Command Prompt or PowerShell window, type the following command to view a list of all active connections and their corresponding port numbers:
netstat -ano | findstr :<Port_Number>
- Replace <Port_Number> with the actual port number you want to close.
- Make a note of the "PID" (Process Identifier) associated with the port you want to close.
- Next, type the following command to terminate the process using the PID:
- Replace <PID> with the actual Process ID you obtained in step 3.