this post was submitted on 08 Oct 2024
1 points (100.0% liked)

Mullvad VPN

13 readers
1 users here now

The unofficial community subreddit for Mullvad VPN.

founded 1 year ago
MODERATORS
 
The original post: /r/mullvadvpn by /u/-Joe- on 2024-10-08 15:25:36.

Mullvad has split tunnelling, which lets you exclude certain apps from the VPN. All you need to do is add the .exe of the app you want to exclude—easy.

This doesn't work for Discord though. Why might you want to exclude Discord? Personally, I run into connectivity issues, higher ping, etc., so I don’t want Mullvad messing with Discord.

The issue with excluding Discord from the tunnel is that Discord stores its app files (including the .exe) in different folders depending on the version. So, the actual .exe is buried inside these version folders.

To get around this, you’ve got two options:

  1. Manually select the .exe inside the (current) Discord folder. But you’ll need to update Mullvad each time Discord updates, to make sure you’re excluding the correct .exe.
  2. Create a batch file that automatically updates a "symbolic link." A symbolic link is essentially a pointer to an existing file—in this case, the Discord .exe. After Discord updates, the symlink still points to the old version of the .exe, so the batch file updates the link to point to the latest version. Combine this with the Task Scheduler, and you can automatically update the symlink. Here's the process:
    • Write a simple batch file that creates or updates the symbolic link whenever Discord updates.
    • Add the symbolic link (not the actual .exe of Discord) to Mullvad’s exclusion list.
    • Set up Task Scheduler (on Windows) to run the batch file automatically, ensuring the link always points to the latest Discord version.

@echo off
setlocal

REM Path to the Discord folder
set "discordDir=C:\Users[user]\AppData\Local\Discord"

REM Find the latest app version folder
for /d %%i in ("%discordDir%\app-\*") do set "latestVersion=%%i"

REM Define the path to the symbolic link
set "symlink=%discordDir%\Discord\_Latest.exe"

REM Remove the old symbolic link if it exists
if exist "%symlink%" del "%symlink%"

REM Create a new symbolic link to the latest version
mklink "%symlink%" "%latestVersion%\Discord.exe"

echo Discord symbolic link updated to the latest version.

endlocal

A few final notes: I'm no batch expert, so I didn’t write the batch script itself. Nor did I come up with this solution on my own (a lot of heavy lifting by ChatGPT). I'm just sharing this since this is how I solved the problem, and I didn't see many solutions when I was looking for an answer, but I'm not in a position to guide anyone step-by-step. <3

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here