Page 1 of 1
Run external program on torrent completion hangs qbtitorrent
Posted: Thu Nov 01, 2012 9:58 am
by yog
System:
windows 7 64bit - NTFS
qBittorent 3.0.6
Test 1:
Run external program on torrent completion: D:\perl\test.bat
test.bat:
Result : After torrent is downloaded qbittorent hangs (program stops responding notifification)
Test 2:
Run external program on torrent completion: cmd.exe
Result : After torrent is downloaded qbittorent hangs (program stops responding notification)
Test 3:
Run external program on torrent completion: D:\perl\test.vbs
vbs:
Code: Select all
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad.exe", 1
Result : After torrent is downloaded qbittorent doesnt do anything with test.vbs (doesnt start notepad.exe)
Test 4:
Run texternal program on torrent completion:
notepad.exe
works fine
Question: is this a bug or am I doing something wrong ?
Re: Run external program on torrent completion hangs qbtitorrent
Posted: Thu Nov 01, 2012 11:09 pm
by loki
I don't think functionality of run on completion has the same capabilities as on linux. I think you can actually pass arguments to programs that you can run in linux. Are you trying to make it do something with the program you're trying to run, or just to open it?
Re: Run external program on torrent completion hangs qbtitorrent
Posted: Fri Nov 02, 2012 6:40 am
by yog
hmm it seems that I forgot to mention why i'm doing this
I want to get msg on gtalk when torrent is finished, so I wrote simple perl script (it works fine outisde qb).
to run it i wrote in Run external program on torrent completion:
It didnt crash qb but did absolutly nothing
so my in my next steps i tried to do the same with cmd.exe, .bat, .vbs. which crash qb [tests in post #1].
So do am i doint smth wrong, or it's a bug ? Any workaround in mind ? Do i need to compile stuff to .exe do python instead perl ?
How to do this ?
Re: Run external program on torrent completion hangs qbtitorrent
Posted: Fri Nov 02, 2012 10:18 am
by Dayman
This is a limitation of QProcess.
Reference code:
https://github.com/qbittorrent/qBittorr ... .cpp#L2144
Possible solution from google:
Code: Select all
QProcess myProc;
QStringList Arg;
Arg << "/c mybat.bat";
myProc.startDetached("cmd.exe",Arg,Catalog);
myProc.waitForFinished();
[quote="loki"]
I don't think functionality of run on completion has the same capabilities as on linux. I think you can actually pass arguments to programs that you can run in linux. Are you trying to make it do something with the program you're trying to run, or just to open it?
[/quote]
Very true. Looks like any nonexcutables must be started from their corresponding programs.
P.S. Would be nice to actually have some kind of error handling here.
Re: Run external program on torrent completion hangs qbtitorrent
Posted: Sun Nov 18, 2012 6:10 am
by grimacester
i have gotten mine to work so far (server 2008 r2):
in qbittorrent on external program completion (without quotes around the whole thing as shown): C:\full\path\here\test.bat "%f" "%n"
contents of test.bat:
echo Run on %date% at %time% >> "C:\full\path\here\testing.log"
echo testing no commands >> "C:\full\path\here\testing.log"
echo %~d1 >> "C:\full\path\here\testing.log"
echo %~p1 >> "C:\full\path\here\testing.log"
echo %~d1%~p1 >> "C:\full\path\here\testing.log"
echo %1 >> "C:\full\path\here\testing.log"
echo %2 >> "C:\full\path\here\testing.log"
echo %3 >> "C:\full\path\here\testing.log"
echo %4 >> "C:\full\path\here\testing.log"
echo %5 >> "C:\full\path\here\testing.log"
echo %6 >> "C:\full\path\here\testing.log"
exit
contents of the testing.log file that is created:
Run on Sun 11/18/2012 at 0:00:44.16
testing no commands
E:
\Completed\
E:\Completed\
E:/Completed/Other
"full name of torrent in quotes"
ECHO is on.
ECHO is on.
ECHO is on.
ECHO is on.
now i move on to testing with label being added... o fun...
hope that helps.