bkvamme Posted October 13, 2011 Report Posted October 13, 2011 Hello! I found a script over at the 7-Zip SourceForge discussion board (http://sourceforge.net/projects/sevenzip/forums/forum/45797/topic/4659614)) that unzip/unrars downloads automaticly. I took that script and enhanced it to make it work with network (UNC/Samba) shares, and I added an option to only run if the torrent downloaded matches a certain label. Lots of credit to ikxcsshcm7 over at the SF discussion board!Requirements: 7-ZipWindowsHere is the script in question: I recommend copying from pastebin to avoid any formatting errors. http://pastebin.com/Wj8yuy7G:: BEGIN TORRENT_DONE.BAT :: :: In uTorrent 'Run Program' :: enter data like: :: C:\SCRIPTS\TORRENT_DONE.BAT "%D" "%N" "%L":: :: INCLUDE QUOTE MARKS :: :: Script was written by ikxcsshcm7 at SourceForge ::::@ECHO OFF SET PATH=C:\PROGRAM FILES\7-ZIP;%PATH% SET JOBDIR=%~1 SET JOBNAME=%~2PUSHD "%JOBDIR%":: If you aren't using network shares, :: comment out the "pushd %jobdir%" line:: and comment in the line below.:: CD/D "%JOBDIR">JOB_"%JOBNAME%".LOG ECHO.%JOBNAME% >>JOB_"%JOBNAME%".LOG ECHO. IF "%3" NEQ "RSS" GOTO DONE:: If you want to restrict the extraction process:: change "RSS" to the label you are using. :: You can also use this to skip specific labels:: by changing NEQ to EQU. IF EXIST *.RAR GOTO UNPACK_RARIF EXIST CD1\*.RAR GOTO UNPACK_CD1_RARIF EXIST *.R01 GOTO UNPACK_R01IF EXIST *.R00 GOTO UNPACK_R00IF EXIST *.00 GOTO UNPACK_00IF EXIST *.ZIP GOTO UNPACK_ZIPIF EXIST *.7z GOTO UNPACK_7zGOTO :NO_UNPACK:UNPACK_RAR7Z x -y *.RAR >>JOB_"%JOBNAME%".LOGIF NOT ERRORLEVEL == 0 REN JOB_"%JOBNAME%".LOG ERROR_"%JOBNAME%".LOGGOTO DONE:UNPACK_CD1_RAR7Z x -y CD1\*.RAR >>JOB_"%JOBNAME%".LOGIF NOT ERRORLEVEL == 0 REN JOB_"%JOBNAME%".LOG ERROR_"%JOBNAME%".LOGGOTO DONE:UNPACK_CD2_RAR7Z x -y CD2\*.RAR >>JOB_"%JOBNAME%".LOGIF NOT ERRORLEVEL == 0 REN JOB_"%JOBNAME%".LOG ERROR_"%JOBNAME%".LOGGOTO DONE:UNPACK_R017Z x -y *.R01 >>JOB_"%JOBNAME%".LOGIF NOT ERRORLEVEL == 0 REN JOB_"%JOBNAME%".LOG ERROR_"%JOBNAME%".LOGGOTO DONE:UNPACK_R007Z x -y *.R00 >>JOB_"%JOBNAME%".LOGIF NOT ERRORLEVEL == 0 REN JOB_"%JOBNAME%".LOG ERROR_"%JOBNAME%".LOGGOTO DONE:UNPACK_007Z x -y *.00 >>JOB_"%JOBNAME%".LOGIF NOT ERRORLEVEL == 0 REN JOB_"%JOBNAME%".LOG ERROR_"%JOBNAME%".LOGGOTO DONE:UNPACK_ZIP7Z x -y *.ZIP >>JOB_"%JOBNAME%".LOGIF NOT ERRORLEVEL == 0 REN JOB_"%JOBNAME%".LOG ERROR_"%JOBNAME%".LOGGOTO DONE:UNPACK_RAR7Z x -y *.7z >>JOB_"%JOBNAME%".LOGIF NOT ERRORLEVEL == 0 REN JOB_"%JOBNAME%".LOG ERROR_"%JOBNAME%".LOGGOTO DONE:NO_UNPACK>>JOB_"%JOBNAME%".LOGECHO.NO FILES FOUND TO UNPACK >>JOB_"%JOBNAME%".LOGDIR/B:DONEPOPD:: If you are not on a network share, you can comment out "popd" aswell.:: :: END TORRENT_DONE.BATI have only tested the script on .rar files, but it should work on all other compress files. Let me know if it doesn't.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.