import winreg import shutil shutil.rmtree("C:\\Users\\Administrator\\AppData\\Local\\Identities") key = winreg.OpenKey(winreg.HKEY_CLASSES_ROOT,"Wow6432Node\CLSID\{B9CDA4C6-C44F-438B-B5E0-C1B39EA864C4}\InprocServr32") winreg.DeleteKey(key,"")