Page 1 of 1

Run an external program on torrent completion

Posted: Wed Jan 01, 2020 9:44 pm
by DJHH
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

Re: Run an external program on torrent completion

Posted: Tue Jan 07, 2020 12:00 pm
by link01
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

Re: Run an external program on torrent completion

Posted: Fri Jan 10, 2020 9:13 am
by DJHH
Thank you for your time. I tested on cmd and it works, I will continue to do tests. :D