Jump to content
Sign in to follow this  

Trying to get autoit to start up and connect a vpn network connection

Recommended Posts

Hi ,

I need to set up a script to automatically run 2 vpn connections. The first one uses an exe file and thus it was easy to script, but the 2nd is a connection that is not an exe file, under All Control Panel Items\Network Connections\<connection name> I have no idea how i can make my script open this and click on the connect button. Is there anyway i can do this?

Thanks for any help!

Share this post

Link to post
Share on other sites

Refer to post.

In the first function ( Func _NicControl($oLanConnection, $bEnable = 1, $bFullName = 1) ), change:

$strEnableVerb = "En&able"

$strDisableVerb = "Disa&ble"


$strEnableVerb = "C&onnect"

$strDisableVerb = "Disc&onnect"

Enable/Disable are used for Network Connections while Connect and Disconnect are used for VPN Connections. I thought there would be a WMI solution for this but I couldn't find anything. So far this is it but it seems to work fine for me!

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...