 <p>1st try/test, changed it into:</p> <pre><code>def purgeOld(): XvbmcEntries = setupXvbmcEntries() for entry in XvbmcEntries: xvbmcaddons = xbmc.translatePath(entry.path) if os.path.exists(xvbmcaddons)==True: for root, dirs, files in os.walk(xvbmcaddons): file_count = 0 file_count += len(files) if file_count &gt; 0: for f in files: try: os.unlink(os.path.join(root, f)) except: pass for d in dirs: try: shutil.rmtree(os.path.join(root, d), ignore_errors=True) except: pass try: shutil.rmtree(xbmc.translatePath(os.path.join('special://home/addons/repository.Blaaat1')), ignore_errors=True) shutil.rmtree(xbmc.translatePath(os.path.join('special://home/addons/repository.Blaaat2')), ignore_errors=True) shutil.rmtree(xbmc.translatePath(os.path.join('special://home/addons/repository.Blaaat3')), ignore_errors=True) dialog.ok("TEST-PURGE", 'we found some orphaned dependencies...','', 'NOTE: a REBOOT is highly recommended!') xbmc.executebuiltin("UpdateLocalAddons") except: pass else: #dialog.ok("Purge test dialog2", "Crap cleaner all done...") pass else: #dialog.ok("Purge test dialog3", "Crap cleaner all done...") pass dialog.ok("Purge dialog DONE!", "everything is as clean as a whistle...") # return </code></pre> <p>This does remove all the folders, but now I have to specify 'what to remove' twice, this does seem a little redundant? (entries are specified in setupXvbmcEntries earlier, now again/extra under try: etc), I assume this can be done prettier, invoke 'xvbmcaddons' again somehowe perhaps?</p>