vendredi 4 mai 2018

Jump!

How  to grab netstat info from program filename?

for /f "tokens=2" %a in ('tasklist /nh /fi "imagename eq silly.exe"') do set pidnb=%a & netstat -aon | findstr /C:"%pidnb%"

As it should be working fine for a first try but second got a tailing space in pidnb...
It needs some polish :(

First time with findstr... ;)

Aucun commentaire:

Enregistrer un commentaire