guys.
I want to use the windows RASDIAL in my app to connect to a VPN.
I'm using this cmd command:
rasdial a-1 username pass
I just want to know, how to save password in this command for the next connects?
Thanks.
Probably the OP already solve the problem (asked 4 years ago), but rasdial
can't save the password. But you can use your stored credentials in Windows with rasphone
. Remember to uncheck "Prompt for name and password, certificate, etc." in the connection properties to skip the dialog.
You can use rasphone.exe to dial a connection using stored credentials:
rasphone -d "VPN NAME"
Hangup with:
rasphone -h "VPN NAME"
You'll also need to go into the option tab of the properties for your VPN connection and uncheck "Prompt for name and password, certificate, etc."
https://superuser.com/a/894969/27235
In Windows 10, rasphone
will always prompt for credentials (Option to skip this step is gone. Thanks, Microsoft!). But I was able to use my saved password with rasdial
by using EAP authentication:
Without EAP, MS-CHAP v2 does not work.
Now I can just execute rasdial VpnName
, and it uses my saved password.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With