Skip to content

Instantly share code, notes, and snippets.

@wynnzen
Last active August 29, 2015 14:05
Show Gist options
  • Save wynnzen/4b0b859731714b67dcbb to your computer and use it in GitHub Desktop.
Save wynnzen/4b0b859731714b67dcbb to your computer and use it in GitHub Desktop.
killadb
import os
import re
com = "5037"
adblist=list()
info = os.popen("netstat -ano|findstr " + com).readlines()
for i in info:
m = re.match(r"\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)", i)
adblist.append(m.group(4))
print adblist
for j in adblist:
os.popen(r"taskkill /f /pid "+j)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment