Create a VPN Connection Programmatically

Posted on 2004-11-18
Last Modified: 2008-03-10
I am trying to develop a call logging program in One of the things that I would like it to do would be to create, or open up, a vpn connection to a remote site and then invoke some sort of remote control program. It is the VPN bit that i am having trouble with.
   I am aware that I could shell back and call rasdial but as far as I can tell this will only work if there is a preconfigured vpn connection on the machine running the program. This call logging program is intended to work form anywhere (and there will be a web client as well) so there is no way that it can possibly be guaranteed that there will be a properly configured VPN DUN in the network and dialup connections bit of windows. As I see it then I have 3 choices, either

1.  Test for the existence of a VPN connection (no prob with rasdial and error levels) and somehow hack into wherever the make new connection wizzard goes and pass the arguments  (held somewhere in a database), which would create a VPN on every computer that, used this.

2.  Try and feed the details (ip address, username, password, VPN type etc.) into the VPN section of the network and dial up connections bit of windows, if i can ever find it, every time a VPN is required (my favourite solution) My workstation is win2k as far as I can tell there is not much difference between the DUN in W2K and XP but worst case scenario I will just detect the operating system and call a different chunk of code depending on the OS

3.  Write a vpn client from scratch (pretty much impossible)
Question by:andylear

    Author Comment

    I found the answer here
    could someone tell me how to withdraw the points used to ask the question here please ?

    Accepted Solution

    Closed, 400 points refunded.
    Community Support Moderator

    Thanks for posting your answer.  Your example demonstrates the true spirit of EE.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now