Auto removal of completed torrents script

Ask for help and report issues with the Windows version of Transmission
Post Reply
cxd1203
Posts: 2
Joined: Thu Oct 03, 2019 9:30 pm

Auto removal of completed torrents script

Post by cxd1203 » Thu Oct 03, 2019 9:50 pm

Hello,

I am trying to write a script (.bat) that removes torrents from the Transmission Windows app (not the daemon) once they are completed.
Here is the code I am using:

Code: Select all

@echo off

set tr_dir="C:\TransmissionScripts"
set tr_app="C:\Program Files\Transmission\transmission-remote.exe"
set host="localhost"
set port="PORT"
set user="USER"
set passwd="PASSWORD"

cd %tr_dir%

%tr_app% %host%:%port% --auth %user%:%passwd% --list | find "100%" > completed-torrents.txt

for /f "tokens=1 delims= " %%a in (completed-torrents.txt) do (
%tr_app% %host%:%port% --auth %user%:%passwd% --torrent %%a --remove
)

del completed-torrents.txt
Once a torrent is completed, the script is launched but its execution seems to be stopped just after the creation of the file "completed-torrents.txt".
When I open the generated txt file, it contains the expected line(s) with the torrent IDs, names etc...
However it never enters the FOR loop and the command to remove the torrents is not executed.

Can you please help me understand what is wrong with this script ?
Many thanks in advance for your help.

yuljk
Posts: 2
Joined: Thu Sep 19, 2019 3:45 pm

Re: Auto removal of completed torrents script

Post by yuljk » Tue Oct 08, 2019 3:48 pm

Hi - I'm also interested in getting this to work. Did you figure out what was causing the issue?

Many thanks

cxd1203
Posts: 2
Joined: Thu Oct 03, 2019 9:30 pm

Re: Auto removal of completed torrents script

Post by cxd1203 » Tue Oct 08, 2019 5:36 pm

Hi,
No update on this subject on my side.
Any help would be greatly appreciated.
Any idea ?

Post Reply