Kodi Community Forum

Full Version: Helper for cleanup of left over files from 4TR & ComSkip
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
== EDIT 2012-09-19: New Version 1.1 available ==
See Post #3


Hi All,

a couple of days ago, I got worried about all this garbage of left over files and I wrote two little helper batch files which clean up the directories from the left-overs from 4TR & ComSkip: *.thmb, *.4tr, *.txt, *.log, etc. - whatever you have left when you deleted a show from the player when having watched them like from XBMC, which only deletes the *.ts file and leaves the rest.

The two cmd files search the directory (and sub, if selected) for files for which no corresponding video file is present and deletes or moves them. Call CleanDir.cmd from your service task or manually in the directory you want to clean up. For any "candidate", it will repeatedly run DelNoTS.cmd to check, if a corresponding *.ts file is present or missing and take action (... or not Wink ).

Maybe anyone may find them useful as well. Adjust them to your needs.

Short info:
  • Simply place the two batch files (*.cmd) in any directory which should be set in your path information (or add the path in CleanDir.cmd to call DelNoTS.cmd)
  • I run CleanDir.cmd from my automated task which also creates the XMLTV file (runtime of this cleanup is approx. 25-45 secs.)
  • Adjust settings by commenting in & out in CleanDir.cmd
  • Adjust file types to apply clean on in DelNoTS.cmd file
  • Only run the CleanDir.cmd command, the second batch is used to check for presence of related *.ts and is called automatically from CleanDir
  • Options: either delete or move the unneeded files, select move-to directory (absolute, relative), recurse sub directories, create a log file, include ComSkip files (makes an additional run to get them all Wink ), add or remove file types you want to be treated or not

Adjust them to your needs, I would be glad if someone can use them.
Download (2,5 kB): http://21x.eu/downloads/CleanDirectory.html

Kind regards from Switzerland - Christoph
Tags: delete left-over files 4TR fortherecord 4therecord comskip move clean cleanup remain service *.txt *.thmb *.log *.csv no corresponding video show recorded
Thanks! Very helpful.
(2012-08-28, 04:06)facted Wrote: [ -> ]Thanks! Very helpful.

Very welcome! I'm glad, if someone can make use of it...

Enhanced version 1.1 available under http://21x.eu/downloads/CleanDirectory.html.

Revision History:
  • Version 1.1: Checks also the existence of other video files to decide, NOT to define files as "left-overs": *.ts (same as V 1.0), *.wtv, *.dvr-ms, *.mpeg, *.mpg, *.mp4, *.mov;
    Other video file types can be added in DelNoTS.cmd easily<br>

Kind regards - Christoph21x
I want to thank you for looking to help the community. Though, in case you are not aware, I wanted to present an alternative...

A small app called Belevadere [http://lifehacker.com/341950/belvedere-a...leaning-pc] is the same or less effort to setup... and it does far more (if you want it too).
Hi Livin, thanks for your information!
I will try this one out - thanks.

Greetz - Chris

EDIT after try: Sad
- must be run as Admin
- crashes, even can't be started many times
- can't look for MISSING files compared to other files files that are existing

=> I stick to my simple batch files... Big Grin

But nevertheless - thanks, Livin!


How do you call this program if it's not placed in the directory you want to run it for? I can't find anywhere in CleanDir.cmd where I can edit the folder I want scanned.

Thanks!
Hi facted,

excuse my late answer - saw your post only now.
It's simple: you call this CleanDir from WITHIN the directory which you want to clean (plus sub-dirs)

Greetz - Christoph