Jump to content

How do I pass parameters to batch file to be run on d\l completion?


Statikk

Recommended Posts

I'm having trouble figuring this out. I'm a newb to more advanced batch files. If someone could just give me an example command line which would be entered in the "Run this program when a torrent finishes:" box and the batch file run by that command line which takes the %L parameter that I'm supposed to pass from uTorrent and either matches it to specified label name and launches notepad.exe or if it doesn't match just exits. I should be able to figure out everything else from there. Thanks in advance for any help.

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...
  • 1 month later...

utorrent sends parameters to a batch file in the same order you list them in the "Run this program..." field. For example if you've entered

C:\MyBatch.bat %L

Then you can reference this in the batch file by using %1.

On that basis, you can do a simple if statement to achieve what you're after:

if '%1'=='TV' notepad
exit

If you intend to make multiple reference so utorrent outputs, then I'd recommend you start with the following in order to make life easier:

set label=%1

Then you can use terms which make more sense in the rest of your code:

if '%label%'=='TV' notepad
exit

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...