To check the active ports on your PC/Server, simply enter the following command in the Command Prompt:
netstat -a

If you want to save the result in an ASCII file, you can add output redirection to the command, as shown in the example below.
netstat -a > c:\Active_Port.txt

In the folder “C:\” , you will find the ASCII file containing the search results, as shown in the image.

Warning: To write to the C: drive, administrator permissions are required. Otherwise, use a different path, such as C:\tmp.