yjuras

Add /quit command line parameter

Recommended Posts

It would be useful to me, and possibly to others, if there was a way to quit uTorrent cleanly from the command line, say for example with a /quit command line parameter.

Details:

I use a VPN and want to run uTorrent only when the VPN is up; a scheduled task on my machine runs this code:

@echo off
rem Waits for VPN to come up then starts uTorrent; kills uTorrent (within a minute or so) if VPN goes down, then starts over

:Check4VPN
nslookup privateinternetaccess.com 2>&1 | find "Server:" | find "privateinternetaccess.com" >nul
if not errorlevel 1 goto VPNisUp
ping 127.0.0.1 -n 61 >nul
goto Check4VPN

:VPNisUP
ping 127.0.0.1 -n 11 >nul
start C:\Users\username\AppData\Roaming\uTorrent\uTorrent.exe /MINIMIZED

:StillHaveVPN
nslookup privateinternetaccess.com 2>&1 | find "Server:" | find "privateinternetaccess.com" >nul
if errorlevel 1 goto LostTheVPN
ping 127.0.0.1 -n 61 >nul
goto StillHaveVPN

:LostTheVPN
taskkill -im uTorrent.exe /t /f
goto Check4VPN

(Just before the PIA VPN comes up, it switches to PIA's nameservers; if the VPN goes down, it switches back to my normal nameservers. I kill uTorrent within a minute which is soon enough for my purposes. When the VPN comes back up, uTorrent is restarted, etc.)

This works quite well, with one exception: killing uTorrent means that it does not quit cleanly and when it is resurrected, it frequently does not complete torrents that were downloading when it was killed. I use RSS feeds and filters extensively to automagically download TV Shows and they are marked as downloaded, yet never complete without manual intervention. This is annoying to me.

BTW- I don't want to use the VPN's kill switch because that would take the entire machine offline and it is only the uTorrent traffic that MUST travel on the VPN. Most of the other traffic is fine with or without the VPN and some of it will not work when the VPN is up. I'm also very much aware that Linux would greatly simplify what I'm trying to do. ATM, it is not an option for this.

Does anyone have a suggestion of how to get what I want without a quit command? If not, can we please get a /quit command?

Thanks for any assistance.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now