Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Windows Get Port by Process Name
for /f "tokens=2 delims=," %F in ('tasklist /nh /fi "imagename eq sqlservr.exe" /fo csv') do netstat -oan | findstr %~F
(Note: Please replace % with %% when running in Batch file instead of Command Line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.