[Win] Sample/Subs directory sorting - working

Come up with a useful post-processing script? Share it here!
Post Reply
GAMBRiNUS
Newbie
Newbie
Posts: 10
Joined: February 5th, 2010, 3:00 pm

[Win] Sample/Subs directory sorting - working

Post by GAMBRiNUS »

I've made a windows version of this:
http://forums.sabnzbd.org/index.php?topic=2004.0

Here's the script:

Code: Select all

@ECHO OFF
D:
cd %1
mkdir Sample
move *sample* Sample
move *.avi Sample
move *.mkv Sample
rmdir Sample
mkdir Subs
move *subs* Subs
rmdir Subs
mkdir CD1
move *cd1* CD1
rmdir CD1
mkdir CD2
move *cd2* CD2
rmdir CD2
mkdir CD3
move *cd3* CD3
rmdir CD3
The command rmdir fails if the folder isn't empty, so if only a sample were moved, then the Subs, CD1, CD2 and CD3 folders are empty and will then be deleted.

Whatever I download is downloaded to my hard drive D:. For some reason I had to add "D:" on the line above "cd %1", as "cd %1" somehow didn't work wherever the command line is started from (probably somewhere on C:). If you're going to use this you may have to replace D: with the drive letter for the disk your downloads are placed on.
Last edited by GAMBRiNUS on May 15th, 2010, 9:38 am, edited 1 time in total.
minimeh
Newbie
Newbie
Posts: 34
Joined: March 26th, 2010, 12:42 pm

Re: [Win] Sample/Subs directory sorting - working

Post by minimeh »

GAMBRiNUS wrote: Whatever I download is downloaded to my hard drive D:. For some reason I had to add "D:" on the line above "cd %1", as "cd %1" somehow didn't work wherever the command line is started from (probably somewhere on C:).
Try "cd /d %1". The /d switch changes current drive in addition to changing current directory for a drive.
Post Reply