ras_init.vbs: Override And Restore Routes With Windows RAS

Posted by: admin  :  Category: Hacks

When initiating a PPP/PPTP connection through Windows RAS you will usually end up with an altered network default route which will redirect all and every traffic through PPP/PPTP.

There are many cases however where such a behaviour is simply not desired, considering Windows RAS providing you with no way to circumvent this, you’re on your own for once more.

I wrote this script, ras_init.vbs, out of the requirement to restore my default route for normal connections and route only specific hosts and networks through PPP/PPTP.

ras_init.vbs is released under the terms of the GNU GPL, version 2. Any feedback is appreciated.


Note: Some time in the past the code of release 0.3 has been lost. As this script is not actively maintained any more, I will not invest time to redo the bugfixes.
The script would need to undergo a major rewrite, maybe in PowerShell, to work on Vista/Windows 7/Server 2008 anyway.


ras_init-0.2.zip

Change Log:


r0.3 2007/06/06

  • fixed a bug with wrong RAS_Routes array enumeration
  • changed script to figure out language settings on its own
  • addedd support for RAS_Name, RAS_User and RAS_Pass attributes to include whitespace characters
  • added support for Windows Vista (requires administrative privileges though)


r0.2 2006/06/16

  • add support for interactive/non-interactive mode

r0.1 2006/06/13

  • initial release
  • tested on Windows 2000/XP
  • searches through all interfaces and looks for the expected RAS subnet address
  • removes RAS default route and replace it by your local default route
  • optionally set up host/network routes for routing through RAS

3 Responses to “ras_init.vbs: Override And Restore Routes With Windows RAS”

  1. Marcel Stutz Says:

    Good Job 🙂

  2. François Charlier Says:

    I dreamt about it, you dit it !

    Thanks a lot !

  3. José da Silva Says:

    Thanks for make it and sharing. 🙂