How to automate ExpressVPN for free with the open-source expresso

ExpressVPN landing homepage
(Image credit: ExpressVPN)

ExpressVPN's desktop apps are simple, well-designed, and so easy to use that even the greenest of VPN newbies will have them figured out right away. But connecting (or disconnecting) still takes a step or two, as you find and open the app, choose a location, click Connect, maybe watch the connection process, then minimize the app's window before you get on with anything else.

Expresso is an open-source Mac and Windows command-line that automates the connect or disconnect processes, without you having to touch the regular ExpressVPN app.

At its simplest, you could create a shortcut which automatically connects you to your preferred ExpressVPN location, or closes an existing connection when you're done. Pin the shortcut to your taskbar and you'll be able to control ExpressVPN with a double-click.

Life gets more interesting when you create your own scripts, though. What about automatically connecting to the VPN whenever you launch your torrent client, for instance? Expresso makes that very easy, and in this article we'll look at how this works.

Try ExpressVPN risk free for 30 days
Not yet got ExpressVPN? 15 months for the price of 12free unlimited secure cloud backup

<a href="https://go.expressvpn.com/c/4550836/1330033/16063?subId1=hawk-custom-tracking&sharedId=hawk&u=https%3A%2F%2Fexpressvpn.com%2Ftechradar%3Foffer%3D3monthsfree%26a_fid%3D744" data-link-merchant="expressvpn.com"" target="_blank" rel="nofollow">Try ExpressVPN risk free for 30 days
Not yet got ExpressVPN?
It currently sits at the very top of our list of <a href="https://www.techradar.com/uk/vpn/best-vpn" data-link-merchant="techradar.com"" data-link-merchant="expressvpn.com"">best VPN services, thanks to its speed, security and sheer simplicity to use. It also has a great track record on unblocking geo-restricted apps and streaming services. There's a 30-day money back guarantee period that will let you try it without feeling tied down, while signing up for an annual plan gets you 15 months for the price of 12 and free unlimited secure cloud backup from Backblaze.


1. Download expresso

Expresso is an open-source project, and potential users or anyone interested can download and browse its source code from the GitHub site.

If you're looking for an easy life and just want the download links, though, we'd recommend heading off to the expresso Releases page, instead.

As we write, there are two main downloads. If you're running Windows, you need the latest expresso-x.x.x-win64.zip archive, and if you're on Mac, you need expresso-x.x.x-osx64.zip.

Grab a copy of the appropriate file, download and unzip it into a folder somewhere.

Expresso needs the ExpressVPN Chrome extension, too, so install that if you haven't already.

The Windows shortcut Properties box

(Image credit: Microsoft)

2. Automate ExpressVPN connections

Open the folder you've just created, right-click expresso.exe and select Create Shortcut.

Right-click the shortcut 'expresso.exe - Shortcut', select Properties, and check the Target box. On our test system, this read: 

"C:\Users\[USER]\Downloads\expresso-1.2.1-win64\expresso.exe"

Whatever the Target box reads on your system, move to the end of the text, press the space bar, type CONNECT and click OK.

Right-click the shortcut, select Rename, and give it a name like 'Connect to ExpressVPN.'

Now repeat the above process to create a new shortcut, this time adding the command DISCONNECT, and renaming the second shortcut to 'Disconnect from ExpressVPN.'

3. Test expresso shortcuts

To test expresso, open the ExpressVPN app so it's visible on your desktop.

Double-click the Connect to ExpressVPN shortcut. If everything's working, you should see the app react as though you'd clicked the Connect button, and it'll connect to your nearest server within a few seconds. Once you've connected, double-click the Disconnect shortcut to test that, too.

If a shortcut doesn't work, right-click it, select Properties, and check the Target text again. You should see a CONNECT or DISCONNECT command after the file path (the commands aren't case-sensitive.)

If the shortcuts look OK, launch ExpressVPN's Chrome extension and click Connect. If the extension works, but expresso doesn't, then the problem is expresso's, and we're out of ideas.

But if the Chrome extension doesn't work, either, then that's likely to be the cause of the problem. Try uninstalling it, then reinstalling, and test it again. If the extension still won't connect, contact ExpressVPN support for advice.

ExpressVPN Windows app location list

(Image credit: ExpressVPN)

4. Connect to specific ExpressVPN countries

Expresso's CONNECT command gets you connected to your nearest server, but what if you want to choose a specific country?

It's so easy you've probably guessed the answer already: just enter the country or city name after CONNECT, separated by a space (CONNECT GERMANY or CONNECT LONDON.)

This gets a little more difficult if the location name has a space in it, like NEW YORK, as expresso won't recognize two words as a single location. To fix this, put the name in quotes, like: CONNECT "NEW YORK"

Create a new shortcut in the expresso folder, as you did above. Add the CONNECT command followed by a country you use regularly, save the shortcut and try it out.

5. Connect to ExpressVPN when you run an app

Chances are that some apps are so important that you'll want to be sure they're always protected by ExpressVPN. It's a hassle to do that manually (plus there's always the chance you'll forget), but expresso makes it much, much easier.

Open Notepad and create a batch file with uses expresso to connect, then launches whatever applications you want to run. Here's an example using Chrome and Word.

@echo off
start "expresso" "C:\Path\To\expresso.exe" CONNECT "new york"
start "Chrome" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
start "Word" "C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE"

Follow the same format with your own app and expresso.exe paths: use the Start command, then put the app name in quotes as a title, then the path in quotes. (Ignore any wrapped text in our example, and make sure the app path is all on a single line.)

When you're done, save the file to the same folder as expresso.exe, using a name such as Connect ExpressVPN with Apps.bat.

To test your script, double click the batch file and watch as expresso gets you connected, and your chosen apps are only launched once ExpressVPN is active.

And if this doesn't work as expected, add the command PAUSE after the others, on a new line, and try again. Your command window will then stay open, allowing you to see any error messages and troubleshoot the problem.

The ExpressVPN Windows app can automatically connect to your last-used location when it launches

(Image credit: ExpressVPN)

6. Run ExpressVPN when your system starts

By this point you should have some handy batch files and shortcuts running genuinely useful tasks. Now all you have to figure out is how are you going to access them?

If you'll use some of these regularly, perhaps to connect to ExpressVPN before you launch an app, then it makes sense to keep them close. Right-click a favorite shortcut, select Pin to Taskbar, and it'll ready to launch whenever you need it.

If a shortcut is really important, maybe automatically connect to a specific location when your system starts, you could set it up to run when Windows launches. 

(Before you try this, make sure the ExpressVPN app won't do what you need already. The Settings, General box already has options to launch ExpressVPN when Windows starts and optionally connect to the last used location, for instance. The only benefit of using expresso is if you always want to start at a specific location, not whatever you were using last time.)

To run a shortcut when your system starts, press Win+R, type shell:startup and press enter to open the Startup folder.

Next, right-click the expresso shortcut you need, and select Copy. 

Finally, right-click inside the Startup folder, select Paste, and you're done. Reboot your system, and ExpressVPN should now run and connect according to your expresso commands.

Mike Williams
Lead security reviewer

Mike is a lead security reviewer at Future, where he stress-tests VPNs, antivirus and more to find out which services are sure to keep you safe, and which are best avoided. Mike began his career as a lead software developer in the engineering world, where his creations were used by big-name companies from Rolls Royce to British Nuclear Fuels and British Aerospace. The early PC viruses caught Mike's attention, and he developed an interest in analyzing malware, and learning the low-level technical details of how Windows and network security work under the hood.