lemonjuiceun Posted May 7, 2013 Report Share Posted May 7, 2013 HiI'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. Link to comment Share on other sites More sharing options...
Harold Feit Posted May 7, 2013 Report Share Posted May 7, 2013 Make a batch file or other script that runs both commands. Link to comment Share on other sites More sharing options...
lemonjuiceun Posted May 7, 2013 Author Report Share Posted May 7, 2013 Thank you.But will it still understand the %D and %N? Link to comment Share on other sites More sharing options...
lemonjuiceun Posted May 7, 2013 Author Report Share Posted May 7, 2013 I tried it. Is does extract and it does send an email. But it just says N finished downloading. Not the same of the actual file.Any suggestions?Thank you. Link to comment Share on other sites More sharing options...
Harold Feit Posted May 7, 2013 Report Share Posted May 7, 2013 The command line arguments change type when passed to the batch file. They become numbered. Link to comment Share on other sites More sharing options...
lemonjuiceun Posted May 7, 2013 Author Report Share Posted May 7, 2013 Okay. So I have to type %2 for example? But what are the numbers for %N and %D? It doesn't say in bittorrent as far as I can find. Only the numbers for alot of other stuff. Link to comment Share on other sites More sharing options...
lemonjuiceun Posted May 11, 2013 Author Report Share Posted May 11, 2013 Bump Link to comment Share on other sites More sharing options...
orangeboy Posted September 14, 2013 Report Share Posted September 14, 2013 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.