Run an external program on torrent completion

Other platforms, generic questions.
Post Reply
DJHH
Newbie
Newbie
Posts: 2
Joined: Wed Jan 01, 2020 9:26 pm

Run an external program on torrent completion

Post by DJHH » Wed Jan 01, 2020 9:44 pm

I don't have experience in programming, I try to Run an external program on torrent completion but is not working.

I put the following: %windir%\system32\notepad.exe "%N", assuming that it will open a text file containing the name of the torrent that has just been completed but nothing happens.

Someone can give a help in that.


Thank you :-\

David

link01
Newbie
Newbie
Posts: 8
Joined: Sun Dec 29, 2019 2:45 pm

Re: Run an external program on torrent completion

Post by link01 » Tue Jan 07, 2020 12:00 pm

Hi David,
notepad.exe does not support a switch to insert text but the echo function can insert that text in.

The command to add text to a file is:

Code: Select all

echo "enter text" > filename.txt
You can chain it to open the text file afterwards:

Code: Select all

echo "enter text" > filename.txt & notepad filename.txt
Works fine in cmd but does not work in qbittorrent. Not sure why but here is my log in case someone knows:

Code: Select all

(N) 2020-01-07T13:20:31 - Torrent: TorrentName, running external program, command: echo "TorrentName" > c:\users\myusername\newtext.txt & notepad newtext.txt

burbigo1
Newbie
Newbie
Posts: 2
Joined: Thu Jan 09, 2020 8:49 pm

Re: Run an external program on torrent completion

Post by burbigo1 » Thu Jan 09, 2020 9:06 pm

Thanks for sharing this code with us

DJHH
Newbie
Newbie
Posts: 2
Joined: Wed Jan 01, 2020 9:26 pm

Re: Run an external program on torrent completion

Post by DJHH » Fri Jan 10, 2020 9:13 am

Thank you for your time. I tested on cmd and it works, I will continue to do tests. :D

Post Reply