Guest User

Untitled

a guest
May 28th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. def disconnect(name):
  2.     tasklist = [line.split() for line in check_output("tasklist").splitlines()]
  3.     killname = [bytes(word, encoding='utf8') for word in name.split()]
  4.     l = len(killname)
  5.     try:
  6.         for line in tasklist:
  7.             if line and line[:l] == killname:
  8.                 pid = int(line[l])
  9.                 kill(pid, 0)
  10.     except OSError:
  11.         pass
  12.  
  13. disconnect('Connectivity Manager.exe')
Advertisement
Add Comment
Please, Sign In to add comment