Jump to content

How To Auto Switch Off if VPN Disconnects?


abrogard

Recommended Posts

I would like to use utorrent mainly on my vpn and often do.

But recently I have found my vpn disconnects, I don't know why,  but utorrent continues on.

Is there some way I can fix it so's utorrent doesn't work if the vpn is disconnected?

Link to comment
Share on other sites

On Windows go to the  Windows Task Scheduler and add a new task with the following settings.

General tab: make sure Run with highest privileges is ticked.

Triggers tab: click New then change the dropdown to On an event, change Log to Application, Source RasClient, Event ID 20226 -this is the event of the VPN disconnecting!

Actions tab: New, choose Action Start a program. In the Program/script: taskkill.exe and in the Add arguments box: /f /im utorrent.exe /FI "STATUS eq RUNNING" - this kills the uTorrent program if it is running.

You don't need to do anything with the other tabs.

(I have a batch file that I created that also runs after uTorrent has been closed and tries to reconnect the VPN but bear in mind that if you manually disconnect for legitimate reasons it will fight you, so you have to code to allow for this.)

On uTorrent, you will probably need to go to Settings | UI Settings | System Tray and make sure Close button closes uT to tray is unchecked.

I hope this helps. :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...