Sign in to follow this  
lemonjuiceun

Run two programs when torrent finishes

Recommended Posts

Hi

I've been using bittorrent for a while now and it's working great. After i've downloaded a torrent i've set winrar to automatically extract them. I put this in the run when torrent finishes line:

"C:\Program Files\WinRAR\UnRAR.exe" x -r "%D\*" "%D"

That's working just fine. But I would also like to run another program upon completion. This one:

sendEmail.exe -f x@x.com -t x@x.com -u subject -m %N finished downloading.

How doI make it so bittorrent will run both programs when download finishes?

Thank you.

Share this post


Link to post
Share on other sites

The numbers are the order you pass the arguments to the batch file. For example, if you pass %D first, it becomes %1. If you pass %N first, it becomes %1.

 

Here's an example script I use to make a "copy" of a just completed torrent, using %D (Directory) and %L (Label):

@ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION::------------------------------------------------------------------:::: Create variables based on arguments passed to the batch file,    :::: where the first argument represents the source (downloaded)      :::: torrent files, and the second argument represents the type       :::: of download (e.g., Audio or Video):                              ::::------------------------------------------------------------------::SET source=%~dp1SET target=I:\Led Zeppelin\Torrent Download\%2PAUSE::------------------------------------------------------------------:::: Ensure target directory exists,                                  :::: Build empty target directory structure:                          ::::------------------------------------------------------------------::IF NOT EXIST "%target%"     MKDIR "%target%"XCOPY /t /i "%~1" "%target%\%~nx1"::------------------------------------------------------------------:::: Loop through all files in source directory,                      :::: Manipulate the file path name to reflect target path name,       :::: Invoke FSUTIL to create new hardlinked file names in the         ::::   target directory structure:                                    ::::------------------------------------------------------------------::FOR /F "tokens=* delims=" %%A IN ('DIR /B /S /A:-D "%~1"') DO (    SET output=%%A    SET output=!output:%source%=%target%\!    FSUTIL hardlink create "!output!" "%%~A")EXIT /B:: Example commandline execution::: Bittorrent_Copy.bat  "%D" %L:: Bittorrent_Copy.bat "I:\Torrents\Seeding\1971.08.26  Houston" Video

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this