Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def disconnect(name):
- tasklist = [line.split() for line in check_output("tasklist").splitlines()]
- killname = [bytes(word, encoding='utf8') for word in name.split()]
- l = len(killname)
- try:
- for line in tasklist:
- if line and line[:l] == killname:
- pid = int(line[l])
- kill(pid, 0)
- except OSError:
- pass
- disconnect('Connectivity Manager.exe')
Advertisement
Add Comment
Please, Sign In to add comment