Right click on "Command prompt" or "PowerShell", in menu click "Run as Administrator" (on Windows XP you can just run it as usual).
As Rick Vanover mentions in See what process is using a TCP port in Windows Server 2008
The following command will show what network traffic is in use at the
port level:
Netstat -a -n -o
or
Netstat -a -n -o >%USERPROFILE%\ports.txt
(to open the port and process list in a text editor, where you can search for information you want)
Then,
with the PIDs listed in the netstat output, you can follow up with the
Windows Task Manager (taskmgr.exe) or run a script with a specific PID
that is using a port from the previous step. You can then use the
"tasklist" command with the specific PID that corresponds to a port in
question.
Example:
tasklist /svc /FI "PID eq 1348"