Before posting, and to avoid disappointment, please read the following:

  • This forum is not for 2BrightSparks to provide technical support. It's primarily for users to help other users. Do not expect 2BrightSparks to answer any question posted to this forum.
  • If you find a bug in any of our software, please submit a support ticket. It does not matter if you are using our freeware, a beta version or you haven't yet purchased the software. We want to know about any and all bugs so we can fix them as soon as possible. We usually need more information and details from you to reproduce bugs and that is better done via a support ticket and not this forum.

Autoconnect (and disconnect) from VPN?

For technical support visit https://support.2brightsparks.com/
Post Reply
Tyree
Knowledgeable
Knowledgeable
Posts: 26
Joined: Tue Aug 12, 2008 3:34 pm

Autoconnect (and disconnect) from VPN?

Post by Tyree »

Is it possibly to have SyncBack automatically connect to a VPN, run a profile, and then disconnect from that VPN on Windows 10?

Thanks!
Conrad Chung
2BrightSparks Staff
2BrightSparks Staff
Posts: 152
Joined: Thu Dec 05, 2013 3:01 pm

Re: Autoconnect (and disconnect) from VPN?

Post by Conrad Chung »

See Modify profile > Expert > Programs - Before (and > After sub-setting page).

You can run either batch/script files or VPN executable via the Before settings. In addition, it's also possible to deliver 'Quit/End-task' commands via the After setting in the profile (assuming your VPN program allows disconnection commands via command-line switches or via batch/script files).

Additional settings are available in the Before/After settings page to run (or Abort) the profile under certain conditions (for example, Abort the profile if your VPN fails to execute, etc). Refer to the contextual Help for more details.

Note that we can't provide bespoke assistance in troubleshooting issues with VPN-related executable command-lines. Please refer to your VPN Help for details.
Tyree
Knowledgeable
Knowledgeable
Posts: 26
Joined: Tue Aug 12, 2008 3:34 pm

Re: Autoconnect (and disconnect) from VPN?

Post by Tyree »

Ah gotcha. I thought it might have something to do with the before and after stuff. Have to research my VPN command line options.

Thanks!
henwin
Newbie
Newbie
Posts: 2
Joined: Wed Mar 25, 2009 12:13 pm

Re: Autoconnect (and disconnect) from VPN?

Post by henwin »

I was able to set up 2 batch files that enable me to be logged in or disconnected from my VPN. I found the necessary command structure online.

It's actually pretty easy to do. First, set up your VPN in Windows 10 and make sure it works.

Then create 2 batch files, using Notepad or some other pure text editor, and put them in a folder on your storage device. (ONLY use a text editor. Most other word processing software won't create the proper text-only file and it won't run even with the .bat extension--or it'll run and give you an error message of some kind. #-o (I did not test this particular configuration, but I am relying on past experience.)

The LOG IN batch file looks like this:

@echo off
rasdial <VPN Name> <UserID> <Password>
exit

You need to fill in your VPN's name, your user ID and your password. Save the file with the file extension .bat . After testing your can rem out (or simply remove) the @echo off command.

The Disconnect file's contents are:

rasdial <VPN Name> /DISCONNECT
exit

Again, fill in your VPN's name in the <VPN Name> location. Save that file with a .bat file extension, too.

Then test them. You will more than likely find they work great, unless you didn't fill in the data correctly. Then use them where needed or call them from within Task Scheduler.
Post Reply