Page 1 of 1

[Win] Sample/Subs directory sorting - working

Posted: May 15th, 2010, 7:58 am
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.

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

Posted: May 17th, 2010, 12:37 pm
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.