Trying to run a .bat file when torrent completes

Specific support for Deluge on Microsoft Windows OS
ambreswe
Member
Member
Posts: 21
Joined: Wed Aug 13, 2014 10:50 pm

Trying to run a .bat file when torrent completes

Post by ambreswe »

Hi there!

Not sure Deluge supports the running of .bat files?

I've tried with:
"Torrent Complete: D:\7zip_unpack_deluge.bat"
"Torrent Complete: D:/7zip_unpack_deluge.bat"
Put it in the Deluge folder "Torrent Complete: 7zip_unpack_deluge.bat"

It's just a simple script that should outout the variables, to see if they're correct, and then pause.
However, nothing happens and there's no error.

Please assist :)

Code: Select all

rem @echo off
torrentid=$1
torrentname=$2
torrentpath=$3
echo "Torrent Details: " $torrentname $torrentpath $torrentid
pause
Cheers!
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Trying to run a .bat file when torrent completes

Post by Cas »

Try with double forward-slash in path, iirc it should work.
ambreswe
Member
Member
Posts: 21
Joined: Wed Aug 13, 2014 10:50 pm

Re: Trying to run a .bat file when torrent completes

Post by ambreswe »

Cas wrote:Try with double forward-slash in path, iirc it should work.
Will try, cheers.
ambreswe
Member
Member
Posts: 21
Joined: Wed Aug 13, 2014 10:50 pm

Re: Trying to run a .bat file when torrent completes

Post by ambreswe »

"Torrent Complete: D://7zip_unpack_deluge.bat"
Nope, that does nothing, please advise.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Trying to run a .bat file when torrent completes

Post by Cas »

Sorry it should have been double-backslash but that shouldn't matter, a normal windows path such as D:\ with be converted anyway.

You won't see an output, you would need it to write to a log so this is the equivalent to the example bash script:

Code: Select all

@echo off
set torrentid=%1
set torrentname=%2
set torrentpath=%3

@echo Torrent Details:  %torrentname% %torrentpath% %torrentid%  >> C:\execute_script.log
ambreswe
Member
Member
Posts: 21
Joined: Wed Aug 13, 2014 10:50 pm

Re: Trying to run a .bat file when torrent completes

Post by ambreswe »

Oh ok, I'll give that a shot :)
ambreswe
Member
Member
Posts: 21
Joined: Wed Aug 13, 2014 10:50 pm

Re: Trying to run a .bat file when torrent completes

Post by ambreswe »

Cas wrote:Sorry it should have been double-backslash but that shouldn't matter, a normal windows path such as D:\ with be converted anyway.

You won't see an output, you would need it to write to a log so this is the equivalent to the example bash script:

Code: Select all

@echo off
set torrentid=%1
set torrentname=%2
set torrentpath=%3

@echo Torrent Details:  %torrentname% %torrentpath% %torrentid%  >> C:\execute_script.log
I'm sorry but nothing runs, if it does, it doesn't give me any indication or log

Now tried with "d:\\7zip_unpack_deluge.bat" and "d:\7zip_unpack_deluge.bat" and the script looks like this:

Code: Select all

rem @echo off
torrentid=$1
torrentname=$2
torrentpath=$3
echo Torrent Details: $torrentname $torrentpath $torrentid >> D:\deluge_exec.log
D:\deluge_exec.log is never created.

Please advise.
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Trying to run a .bat file when torrent completes

Post by Cas »

That is not a valid batch file. You need to have the script set up exactly the same as my example and ignore anything I said previously about the slashes I already said it wasn't an issue.
ambreswe
Member
Member
Posts: 21
Joined: Wed Aug 13, 2014 10:50 pm

Re: Trying to run a .bat file when torrent completes

Post by ambreswe »

Cas wrote:That is not a valid batch file. You need to have the script set up exactly the same as my example and ignore anything I said previously about the slashes I already said it wasn't an issue.
Eeeh I think I know batch :P
What should not be valid about mine?
It doesn't like the "rem" lines?? Sounds weird.
ambreswe
Member
Member
Posts: 21
Joined: Wed Aug 13, 2014 10:50 pm

Re: Trying to run a .bat file when torrent completes

Post by ambreswe »

Ok I did excactly as you described.

Code: Select all

@echo off
torrentid=$1
torrentname=$2
torrentpath=$3
echo Torrent Details: $torrentname $torrentpath $torrentid >> D:\deluge_exec.log
it does absolutely nothing. no execute, no output.
Post Reply