Page 1 of 1

[Windows] question about a script to delete garbage files

Posted: July 26th, 2012, 2:54 pm
by moveright
I was doing a little reading here about simple scripts with .CMD file extensions. Reminds me of the days of MS-DOS and writing batch files.

Anyhow, I'm looking to create a simple script to run after a movie is downloaded to clean it up before it is moved to the movie folder and then scraped using ember media manager.

What I notice when most movies download is that in the folder containing the movie file, there are often .srt, .nfo, etc.

If I were to write a script that would delete everything other than the video file would it look something like this?

Code: Select all

del *.srt
del *.nfo
and so forth and so on?

Also, this may be asking a bit much but I'll shoot anyhow...

Occasionally the movie is in a double duplicate folder for example

MOVIE_FOLDER>MOVIE_FOLDER>movie file

If I wanted to reduce this to just one movie folder with the file inside, what would that look like? possible?

Thanks in advance!

Re: [Windows] question about a script to delete garbage file

Posted: July 26th, 2012, 4:05 pm
by shypike
The batch file is not needed, use extension-based cleanup in Config->General (yeah, odd place).
Should you want to use a batch file anyway, this is the correct one:

Code: Select all

@echo off
cd %1
del *.srt *.nfo
For getting rid of folders, use Config->Sort->GenericSort for your movie category.
Be sure to use 0.7.3Beta1 though.

Re: [Windows] question about a script to delete garbage file

Posted: July 26th, 2012, 6:15 pm
by moveright
Ok, I've got it set up per your instructions. THANKS!

one more thing if you don't mind, actually two...
1. what does the % operator do?
2. In generic sorting, I have sort movies enabled and I've got it set up to correctly name the folder and movie title inside. However, to the left, it says "affected categories" and there are (4). Two of which are movie cats but the other two are "default" and "tv". I don't want anything to be done to downloaded tv shows because I've got sabtosickbeard.exe hooking that up.

Am I good?

Re: [Windows] question about a script to delete garbage file

Posted: July 27th, 2012, 3:02 am
by shypike
cd %1 in this context means: select the folder of the downloaded job.
In Generic sorting, select any category that you want Sort applied to.
It's a multiple selection list (Control-click each element to toggle its selection).
High-lighted means selected. Then click Save.