Jump to content

Scripts don't run properly...


hammerfluff

Recommended Posts

Hi guys,

I am having a little problem with my scripts not running when the status changes to seeding. It works absolutely fine when I click top and start again manually, however when utorrent is running minimised and something finishes downloading, say overnight, it has not executed the script at all!

Is this the way it is supposed to be? Or is this a bug that others are finding? It really has me stumped, and its kinda pointless having to go through and stop and restart all your torrents in order to get them to be copied, this is hardly complete automation!

Any ideas would be greatly appreciated! The code is below but I don't think that is the issue....

@echo off
title adaptation of Axmans torrent-file script
rem Parameter usage: fromdir torrent-name label kind [filename]
rem corresponds to uTorrents flags: %D %N %L %K %F %S
echo *********************************************
echo Run on %date% at %time%
echo Status =%6
set fromdir=%~1
set name=%2
set label=%~3
set kind=%4
set filename=%5
set savepartition=D:\Users\Public\Videos

set moviedir=%savepartition%\%label%
set label_prefix=""
set state=%6
echo Input: %fromdir% %name% %label% %kind% %filename% %state%

rem Determine length of label string
rem echo.%label%>len
rem for %%a in (len) do set /a len=%%~za -2
rem This is to pick up if label begins with "Shows" (ex. "Shows\Boardwalk Empire")
rem if %len% geq 7 set label_prefix=%label:~1,5%
rem echo label_prefix = %label_prefix%

echo %date% at %time%: Handling torrent %name% >> D:\Utorrent\handled_torrents.txt

rem If label is "Movies"
if %3 =="None" (
echo No label, file will be left alone.
GOTO:EOF
) ELSE ( goto movies)

rem xcopy switches:
rem S Copies directories and subdirectories except empty ones.
rem I If destination does not exist and copying more than one file, assumes that destination must be a directory.
rem L Displays files that would be copied. FOR DEBUG
rem Y Suppresses prompting to confirm you want to overwrite an existing destination file.

:movies
if not %state%=="5" GOTO:EOF
echo **Movie
set todir=%moviedir%
echo todir =%todir%
rem If there are rar files in the folder, extract them.
rem If there are mkvs, copy them. Check for rars first in case there is a sample.mkv, then we want the rars
if %kind%=="single" goto copyfile
if exist %fromdir%\*.mkv goto copymkvs
if exist %fromdir%\*.avi goto copyavis
if exist %fromdir%\*.rar goto extractrar
echo Guess we didnt find anything
GOTO:EOF


:copyfile
rem Copies single file from fromdir to todir
echo Copy %filename% from %fromdir% to %todir%
xcopy "%fromdir%\%filename%" "%todir%\" /S /Y
GOTO:EOF

:copyavis
echo Copy all avis from %fromdir% and subdirs to %todir%
echo xcopy %fromdir%\*.avi %todir%\ /S /I /Y
xcopy "%fromdir%\*.avi" "%todir%\" /S /I /Y
GOTO:EOF

:copymkvs
echo Copy all mkvs from %fromdir% and subdirs to %todir%
xcopy "%fromdir%\*.mkv" "%todir%\" /S /I /Y
GOTO:EOF

:extractrar
echo Extracts all rars in %fromdir% to %todir%.
rem Requires WinRar installed to c:\Program files
if not exist "%todir%" mkdir "%todir%"
"c:\program files\winrar\winrar.exe" x -ilog "%fromdir%\*.rar" "*.*" "%todir%"
GOTO:EOF

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...