Last active
November 19, 2016 19:58
-
-
Save mayrund/d7c0678821a17f2fc4aec502397836ca to your computer and use it in GitHub Desktop.
Windows Get Port by Process Name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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