Jump to content

Recommended Posts

Posted

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!

Posted

Refer to post.

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

$strEnableVerb = "En&able"

$strDisableVerb = "Disa&ble"

To:

$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!

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
×
×
  • Create New...