I am looking for a way to create a new VPN connection using only the command line. All I see in Google searches are how to connect to an existing VPN connection, which is through rasdial. Thanks.
-
What has this got to do with Java? – martin clayton Jan 24 '12 at 22:17
-
I was hoping to execute the command line through java. If there are any APIs I can use that can allow me to directly create a VPN connection in Java, it would help a lot. – louieansonng Jan 25 '12 at 04:34
2 Answers
Cisco VPN can connect using the Command line.You can create your own script files that use the CLI commands to perform routine tasks, such as connect to a corporate server, run reports, and then disconnect from the server. To display a list of all VPN Client commands, go to the directory that contains the VPN Client software, and enter the vpnclient command at the command-line prompt: http://www.cisco.com/en/US/docs/security/vpn_client/cisco_vpn_client/vpn_client46/administration/guide/vcAch5.html

- 1
- 1
You can try to use RAS API directly from Java.
If you want to create VPN connection from pure CMD, I'd try to append connection info to rasphone.pbk file in user's profile (%APPDATA%\Microsoft\Network\Connections\Pbk\rasphone.pbk
).
For more ideas see How can I programmatically create a Windows VPN connection?
-
I think the link you gave me with regards to the other question in stackoverflow states a solution in C#. Is it possible to use C# libraries in Java? – louieansonng Feb 09 '12 at 03:15
-
I am not a Java developer, but I think this may help you http://stackoverflow.com/questions/420617/accessing-net-dll-libraries-components-from-java – MBu Feb 09 '12 at 09:12