Sign in to follow this  
Followers 0
Guest Gward

Startup Vpn

13 posts in this topic

#1 ·  Posted (edited)

I am a beginner with Autoit. I'm looking for a command to startup a VPN connection with XP or to start a shortcut. I have no exe file or lnk. I can make a *.lnk, but don't know how tot run a shortcut in autoit.

Thanks

Edited by Gward

Share this post


Link to post
Share on other sites



What do you want open if you have no .exe? :whistle:

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

If you want to make a VPN connection in windows XP, you can use the connection wizard. After the (network)connection is made, there is an icon in the Networkmap. This is not a windows-shortcut, but it is possible to make a shortcut on, for example, the desktop, or somewhere else in the root.

I made a shortcut on the desktop and now I want to start this shortcut. I think this is the only way to start up the VPN connection (because there is no exe file of the VPN connection). A few days ago I saw a command to start a shortcut in this forum, but I can't find this anymore. :whistle:

So, two questions: does anyone know a command to start a VPN connection and what is the command to start a shortcut (Run works only with a exe file.)?

Thanks

Edited by Gward

Share this post


Link to post
Share on other sites

Run(@COMSPEC & ' /c "H:\System Stuff\Profile\Desktop\MyShortcut.lnk"',"", @SW_HIDE)
:whistle:

Share this post


Link to post
Share on other sites

Thanks for your code, but you won't believe it: it will work with every *.lnk, but not with a VPN link :whistle: So I am still looking for a solution.....

Share this post


Link to post
Share on other sites

Strange. Perhaps you could try calling the shortcut from a batch file?

REM someBatchFile.bat
"H:\System Stuff\Profile\Desktop\MyShortcut.lnk"

; AutoIt script ...
Run("someBatchFile.bat","", @SW_HIDE)

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Before you try that, is it really a shortcut? Maybe it created a special object on your desktop which isn't a true shortcut, but exhibits the same behavior as one.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

the command to start a connection is:

C:\Windows\system32\RasPhone -d "connectionname"

this also works with a VPN definition...

in autoit syntax:

run(@SystemDir & '\RasPhone -d "connectionname"')
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks JdeB. :whistle: Your code was the one I was looking for. It's working fine!

Gward

Share this post


Link to post
Share on other sites

Sorry to bring back old posts, but can someone tell me what i would need to change in both those lines to close the connection?

Share this post


Link to post
Share on other sites

From a command prompt type "rasdial.exe /?" and it will show all of the options.

I use

Rasdial.exe "My Connection"  myusername mypassword

And

rasdial.exe "My Connection" /disconnect

You need to use quotes on the connection name/username/password entries if they have spaces in their names

there are other options you can use such as including a domain name and phone number as well


We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites

thanks both of you....

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  
Followers 0