Windows 10: How to connect/disconnect to a VPN using the command line?


  1. Posts : 4
    Windows 10 Pro 64bit
       23 Aug 2015 #1

    How to connect/disconnect to a VPN using the command line?


    Hi all

    I have several network connections configured.

    • There is one wifi connection which automatically connects to my WLAN,
    • another cable based LAN connection to a NAS which is used for backups
    • and some L2TP connection connections (used for VPN if needed).


    Is there a way to connect to these VPNs via the command line (so that I can have a "Batch" File which starts or stops this connection)? I already tried to find something but havent found a solution.
      My ComputerSystem Spec

  2.    14 Sep 2015 #2

    rasdial now broken in windows 10


    it might be that i need to install some additional windows features now i upgraded to 10 but previously this rasdial command line worked for me to do this

    C:\Windows\System32\rasdial.exe "VPNname"

    EcoGex said: View Post
    Hi all

    I have several network connections configured.

    • There is one wifi connection which automatically connects to my WLAN,
    • another cable based LAN connection to a NAS which is used for backups
    • and some L2TP connection connections (used for VPN if needed).


    Is there a way to connect to these VPNs via the command line (so that I can have a "Batch" File which starts or stops this connection)? I already tried to find something but havent found a solution.
      My ComputerSystem Spec


  3. Posts : 4
    Windows 10 Pro 64bit
    Thread Starter
       17 Sep 2015 #3

    lucasrenzi said: View Post
    it might be that i need to install some additional windows features now i upgraded to 10 but previously this rasdial command line worked for me to do this

    C:\Windows\System32\rasdial.exe "VPNname"
    Does not work here. Says there is an incorrect combination of username and/or password.
    But they are working if started via control panel.
      My ComputerSystem Spec

  4.    24 Sep 2015 #4

    EcoGex said: View Post
    Does not work here. Says there is an incorrect combination of username and/or password.
    But they are working if started via control panel.
    Seems the username and password saved in control panel isnt used by rasdial in command prompt. instead you need to put the user/pass into the command line:

    C:\Windows\System32\rasdial.exe "VPN" "username" "password"
    use the same command with /disconnect to switch it off
      My ComputerSystem Spec

  5.    01 May 2016 #5

    lucasrenzi said: View Post
    C:\Windows\System32\rasdial.exe "VPN" "username" "password"
    Tried this cmd but no luck:
    Remote Access error 703 - The connection needs information from you, but the application does not allow user interaction.

    For more help on this error:
    Type 'hh netcfg.chm'
    In help, click Troubleshooting, then Error Messages, then 703
    What I'm doing wrong?
      My ComputerSystem Spec


  6. Posts : 1
    Windows 10 Home
       14 Apr 2017 #6

    lucasrenzi said: View Post
    Seems the username and password saved in control panel isnt used by rasdial in command prompt. instead you need to put the user/pass into the command line:

    C:\Windows\System32\rasdial.exe "VPN" "username" "password"
    use the same command with /disconnect to switch it off
    Thank you vary much. Both commands work flawlessly in Win 10 Pro last updated on 12th April 2017.
      My ComputerSystem Spec


 

Related Threads
If you are not familiar with package managers I recommend you read first the short Chocolatey package manager tutorial at our sister site Windows Eight Forums as an introduction to this tutorial: Chocolatey - Install Apps from Command Line. Although...
Hi! In Windows 10 is new app for photos and albums as default picture viewer. In Windows 8.1 I used JPEGView, and sometimes Windows Photo Viewer. Now I'm customizing Windows and I know how to start Photo Viewer from cmd and created context menu...
Solved Network Disconnect and Reconnect in Network and Sharing
Hello Since upgrading to Windows 10 I been getting random network disconnects? in Event Viewer I get load of these errors Event 27 Intel(R) 82579V Gigabit Network Connection Network link is disconnected. Event 33 Intel(R) 82579V Gigabit...
Playing around with Windows 10 I set up my mail account in the Mail app. I don't like it and don't want to use it. How can I remove my settings from that app and remove it from the tiles I see when I click the windows button?
Hi there Cisco VPN connects fine to target VPN - but there's now no Disconnect option -- need to re-boot to quit VPN. VPN software glitch or Windows. ? I'm using the latest build - Build 10049. Build 10041 wouldn't connect at all so at...

Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 08:29.
Find Us