Last active
August 29, 2015 14:05
-
-
Save wynnzen/4b0b859731714b67dcbb to your computer and use it in GitHub Desktop.
killadb
This file contains 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
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