How To: Automatically Organize Your Torrents with Batch Scripting

Automatically Organize Your Torrents with Batch Scripting

Warning

  • Don't torrent things that you do not have the rights to torrent. Everything I torrent, I have a physical copy of, and just want a copy on my computer without causing wear-and-tear on my DVD drive's laser. Piracy is naughty.

I used to get extremely frustrated with Bit Torrents. I stream all of my media at home to all of my devices, but only from specific folders. I would start a download of a movie, relax until it was done, then wish that it would somehow auto-magically move my torrents into their corresponding folders when they finished (Ex: /music, /video). This way, I could lay in bed, watching movies via streaming on my Xbox 360, and then have the movies automatically available as soon as they were done downloading. This dream wasn't so far fetched, once I got to thinking.

In this Power Byte, I'm going to demonstrate, in the video below, how to edit my batch script that will move your torrented audio and video files to your corresponding audio and video directories. A batch script is just a group of commands that are executed in the terminal. After the batch script is made, we will make the uTorrent client call it every time a torrent is complete.

Below is the code for the actual script:

@echo off
set music=C:\Documents and Settings\Owner\My Documents\My Music
set video=C:\Documents and Settings\Owner\My Documents\My Videos
set dlDir=C:\Documents and Settings\Owner\My Documents\Downloads

move %dlDir%*.avi %video%
move %dlDir%*/*.avi %video%
move %dlDir%*.mp4 %video%
move %dlDir%*/*.mp4 %video%
move %dlDir%*.mkv %video%
move %dlDir%*/*.mkv %video%
move %dlDir%*.mp3 %music%
move %dlDir%*/*.mp3 %music%

That's all there is to it! I encourage the hacking of this script by people! Post it in the Forums!

7 Comments

"...without causing wear-and-tear on my DVD drive's laser." Haha most BS excuse of all time.

What's your excuse? ;D

i thought the exact same thing...funny thing is torrenting actually does cause wear and tear on your hard drive...quite a bit.....the more you know /rainbow.

Yeah, but the life expectency of HDD's are quite long, as are SSD's. Disc drives burn out rather easily, I've gone through 2 in the past year :(.

You inspired me to make one that unrar's a file once it's downloaded and put it on my desktop. As i usually download scene releases this is generally the state of my completed downloads.

It requires:
1) Set OUTPUT to the output directory (where the files will be placed) and RAR to the 7zip directory (you need 7zip installed, it's free). Be sure to maintain the quotations around the path(if there are spaces in these paths it will not work without quotations).
2) The 'Run this program when a torrent finishes' box in utorrent to contain: [full path to the batch file] "%D". For example that box in my utorrent contains: C:\Users\Name\Downloads\e.bat "%D"

This batch code is:
@echo off

set OUTPUT="C:\Users\Name\Desktop\"
set RAR="C:\Program Files\7-Zip\"

%RAR%7z.exe e -o%OUTPUT% -y %1\*.rar
%RAR%7z.exe e -o%OUTPUT% -y %1\*\*.rar

This is the kind of thing I encourage, nice! I hate when uploaders use archives, haha. You should be a part of the programming competition that is going to be happening at the end of the week ;)

your script wont work. you forgot to account for the spaces in the dir names. you need to add double quotes

Share Your Thoughts

  • Hot
  • Latest