I use a VPN to connect to the office from home. I use Windows XP's built-in VPN support for this.
Due to some unfortunate subnet choices, I must run a script to set up some network routes every time the VPN connection has been established. At present, this is a batch file that invokes a PHP CLI script.
The VPN connection is limited to 12 hour sessions; Windows will automatically re-establish the connection, but how can I tell it to invoke my routes script once it's done so?
(If I don't, some buggy software I use leaks file descriptors like nobody's business as it keeps trying to re-establish the connection, and sometimes this causes problems for me: if the machine is unattended, networking becomes unusable after a few hours and I have to reboot, rather than my preference of hibernating all the time.)
route. If your static routes don't exist, but the VPN link is up, then add the routes. BTW have you tried passing the-poption to route to setup a persistent route? – Zoredache Sep 21 '11 at 22:18