How to locate open and used ports

Use command prompt command 'NETSTAT' to find the ports the system currently listening to and also to find out the ports the system has currently established.
c:>netstat -an |find /i "listening"
c:>netstat -an |find /i "established"
c:>netstat -an |find /i "listening" > c:\ports.txt Exports the results to file.