Advertisement
Guest User

Untitled

a guest
Aug 30th, 2011
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.66 KB | None | 0 0
  1. ###
  2. ### "Kill Skype Home 4 Ever"
  3. ###
  4. ### This little python code is intended to remove the annoying autostart behaviour
  5. ### of the Skype Client on Windows which opens automatically the "Skype Home" window
  6. ### on every startup of the skype client.
  7. ###
  8. ### This code removes the relevant setting from the Skype Software's internal settings db.
  9. ###
  10.  
  11.  
  12. ###
  13. ### Download Executable from:
  14. ### http://ge.tt/9zElhI7?c
  15. ###
  16.  
  17. import sqlite3
  18. import os
  19. import ctypes
  20. from ctypes import wintypes, windll
  21.  
  22. # Thanks to: http://stackoverflow.com/questions/626796/how-do-i-find-the-windows-common-application-data-folder-using-python/626927#626927
  23. # for this function
  24. # Look for the user's appdata path on a windows system
  25. def appdata():
  26.     CSIDL_COMMON_APPDATA = 35
  27.     CSIDL_APPDATA = 26
  28.  
  29.     _SHGetFolderPath = windll.shell32.SHGetFolderPathW
  30.     _SHGetFolderPath.argtypes = [wintypes.HWND,
  31.                                 ctypes.c_int,
  32.                                 wintypes.HANDLE,
  33.                                 wintypes.DWORD, wintypes.LPCWSTR]
  34.  
  35.     path_buf = wintypes.create_unicode_buffer(wintypes.MAX_PATH)
  36.     result = _SHGetFolderPath(0, CSIDL_APPDATA, 0, 0, path_buf)
  37.     return path_buf.value
  38.  
  39. # Build path
  40. pt = os.path.join(appdata(), 'Skype', 'shared_dynco', 'dc.db')
  41.  
  42. # Open conection to SQL-Lite database
  43. conn = sqlite3.connect(pt)
  44.  
  45. # Modify the webapps entry in bupdate table
  46. # Thanks to: http://www.tipps-tricks-kniffe.de/skype-home-ausblenden-so-deaktivieren-sie-die-uberflussige-skype-home-ansicht/
  47. conn.execute("""UPDATE bupdate
  48.          SET body='<webapps></webapps>'
  49.           WHERE uri='ui/webapps/config/1197'""")
  50.  
  51. # Save (commit) the changes
  52. conn.commit()
  53.  
  54. # We can close the connection now
  55. conn.close()
  56.  
  57. # done and goodbye
  58. quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement