@echo off REM This script will show what TCP and UDP ports are listening and show what programs are listening on those ports. REM It will also show the TCP and UDP connections that are established on the computer and what programs are connected. REM Just match the PID (Process ID’s) to find out what programs are using the ports. REM The ports will be listed above the dashed line and the programs will be listed below. REM Robert Holland @echo Open ports and running applications for %computername% > %computername%.Ports.txt netstat -ano >> %computername%.Ports.txt @echo.>> %computername%.Ports.txt @echo.>> %computername%.Ports.txt @echo "———————————————————————————" >> %computername%.Ports.txt @echo "——————programs that are listening are listed below. Just match the PID from above.——————-" >> %computername%.Ports.txt @echo "———————————————————————————" >> %computername%.Ports.txt tasklist /svc >> %computername%.Ports.txt call notepad %computername%.Ports.txt REM find /I "Listening" %computername%.Ports.txt >> %computername%.Listening.txt REM find /I "Established" %computername%.Ports.txt >> %computername%.Established.txt REM find /I "Listening" %computername%.Ports.txt >> \\servername\sharename\%computername%.Listening.txt REM find /I "Established" %computername%.Ports.txt >> \\servername\sharename\%computername%.Established.txt REM End of Script