Thanks for visiting Daily Cup of Tech!
Here are a few things that you may want to do while you are visiting:

Hope you enjoy your stay!


It has been long time since I have watched television like “normal” people. Ever since I found bittorrent, there was no turning back!

The problem that I have is that I am a pack rat! Once I download a TV episode, I don’t want to get rid of it. After all, I used up all that bandwidth!

So, I’ve started organizing my television shows into three categories:

  1. Downloaded - these are shows that have just completed downloading and are in their original form from the Internet
  2. Unsorted - these shows are in in one central location and should be in playable format. These are all my new shows that I probably have not watched yet
  3. Sorted - once I have watched a show, the shows get moved into appropriate folders based on series and season name

The issue that I have run into in the past is that once an episode is downloaded, it may not be in playable format since many shows are archived, typically into RAR files. This means that I needed to manually extract these files or move the playable files to the Unsorted folder so that I could watch them.

I finally got fed up with this and I thought that there had to be a better way. It took me a couple of evenings work but I finally came up with a batch files that does the work for me! I simply have Windows programmed to run the batch file on a regular basis and it extracts all of the RAR files to my preferred location and moves all of the AVI files there as well (without copying the samples).

Here is the contents of that batch file:

@echo off
setlocal
cls

rem Set program variables below:
rem sourcedir - where files are saved once they have been downloaded
set sourcedir=C:\Downloaded

rem destinationdir - where you want all of the playable files to be placed
set destinationdir=C:\Unsorted

rem winrarpath - location of the unrar program
set winrarpath=C:\Program Files\WinRAR\

rem filelist - the name of the file which will store all of the RAR and AVI file names that have been processed
set filelist=FoundFiles.txt

rem tempfile - name of the temporary file that will be created and then deleted during the cleanup process
set tempfile=TempFile.txt

set path="%winrarpath%";%path%

echo Extracting new RAR files...
for /R "%sourcedir%" %%R IN (*.rar) DO find /C "%%R" %filelist% > NUL & if errorlevel 1 call unrar e -o- -y "%%R" *.* %destinationdir%\ & echo %%R>>%filelist%

echo Adding sample AVI files to no copy list...
for /R "%sourcedir%" %%R IN (*sample*.avi) DO find /C "%%R" %filelist% > NUL & if errorlevel 1 echo %%R>>%filelist%

echo Moving new AVI files...
for /R "%sourcedir%" %%R IN (*.avi) DO find /C "%%R" %filelist% > NUL & if errorlevel 1 echo Copying %%R... & copy "%%R" %destinationdir%\ & echo %%R>>%filelist%

echo Cleaning up %filelist%...
for /F %%R IN (%filelist%) DO if exist "%%R" echo %%R>>%tempfile%
del %filelist%
rename %tempfile% %filelist%

All you need to do is copy this file and save it as TorMove.cmd.  Then edit the three variables:

  • sourcedir
  • destinationdir
  • winrarpath
  • filelist
  • tempfile

Only the first three are critical.  You just need to make sure that the last two do not clash with other files.

Also, you do not need to use WinRAR.  If you do not have this program, UnRAR for Windows will work just fine.

Once you have modified your file, save it and then schedule Windows to run it as often as you want!

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?