• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1194
  • Last Modified:

Batch file to open a VPN connection

Would anyone be able to provide the code needed to write a batch file that opens an existing VPN connection?

Many thanks

John
0
digital-doctors
Asked:
digital-doctors
  • 4
  • 2
1 Solution
 
TvMptCommented:
Depends wich vpn client are you using.
I use VPN Cisco Client and works only with a click ( open and connect)
You could put that shortcut in start up also and will connect in windows startup.
0
 
digital-doctorsAuthor Commented:
I'm using the standard Windows VPN client which I don't think will fully connect by simply adding it to the startup, it may open the connection window but that's all. My purpose for trying to do this is to automate the copying of an archive from the client PC to a server in remote location. If I can schedule a batch file to open the VPN I can then schedule and batch file to copy and send the archive file. I've found the following script command:
rasdial vpn_connection_name username password

but when I've tried it, it returns a 623 error "The system could not find the phonebook entry for this connection"

Any other thoughts?
0
 
TvMptCommented:
Do you will intereact with pc in that process?
I know that could not be the right choice but you can use a record macro....with all clicks and mouse movements.
Not a clean solution but most time do the job well done.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
TvMptCommented:
and rasdial will only work with dial-up/PPPoE connection i guess
0
 
TvMptCommented:
ups my mistake...will work with vpn too.

Error 623

The system could not find the phone book entry for this connection.

To work around this issue:

   1. Click Start, click Control Panel, and then click Network and Internet Connections.
   2. Click Network Connections.
   3. Right-click the VPN connection, and then click Properties.
   4. Click to select the Dial another connection first check box, and then click the appropriate dial-up connection. If there are no dial-up connections to select, you may have to create a dial-up connection and repeat these steps.

      If your VPN connection does not require a dial-up connection, click to clear the Dial another connection first check box, and then click OK.
0
 
digital-doctorsAuthor Commented:
I've already been through the steps you've just offered, there was no tick in the "Dial another connection" setting but the issue still persists. The macro option sounds possible though I would like to exhaust all options with the batch first.

Thanks for the input
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now