Skip to content

Instantly share code, notes, and snippets.

@Knewest
Last active April 30, 2025 13:03
Show Gist options
  • Save Knewest/ee59d3960e18e6d813c9221b54b36ab1 to your computer and use it in GitHub Desktop.
Save Knewest/ee59d3960e18e6d813c9221b54b36ab1 to your computer and use it in GitHub Desktop.
Reinstall BetterDiscord seconds after Discord uninstalls it against your will. Avoid using the time consuming installer with this trick.

How to make BetterDiscord easier to install repeatedly:

  1. Download and install these two CLI tools:

  2. Create a permanent folder on your file explorer named something like BetterDiscordReinstall.

  3. Depending on your Discord client, place the two batch programs in the folder:

    Stable Discord:

    Discord Public Test Build:

    Discord Canary:

  1. For the initial setup, run the FullyReinstallBetterDiscord.bat batch program and a BetterDiscord folder will be created within the folder.
  1. If BetterDiscord ever uninstalls itself, run the QuickReinstallBetterDiscord.bat batch program and it will bring BetterDiscord back within a literal second.

  2. Ideally, right click the folder you created and pin it to the quick access bar so you can quicky reinstall BetterDiscord if it is uninstalled by Discord:

    https://cdn.discordapp.com/attachments/1071870103513210990/1104006791651672114/IeTG4OyRpc.webp


    Note:
    If QuickReinstallBetterDiscord.bat ever stops working, just rerun the FullyReinstallBetterDiscord.bat batch program to hopefully fix it. If this doesn't work either, Discord may have broken BetterDiscord and you will need to wait for BetterDiscord to release a patch/update addressing it.



Thank you for using my guide, I hope it helps greatly. Now you no longer have use the installer over and over again, which is time consuming.
- Knew
set START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord Canary.lnk
taskkill /F /IM DiscordCanary.exe
if exist "%START_MENU_PATH%" (
git clone https://github.com/BetterDiscord/BetterDiscord.git
cd betterdiscord
npm install -g pnpm
pnpm install
pnpm build
pnpm inject canary
start "" "%START_MENU_PATH%"
)
set START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord Canary.lnk
taskkill /F /IM DiscordCanary.exe
if exist "%START_MENU_PATH%" (
cd betterdiscord
pnpm inject canary
start "" "%START_MENU_PATH%"
)
set START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord PTB.lnk
taskkill /F /IM DiscordPTB.exe
if exist "%START_MENU_PATH%" (
git clone https://github.com/BetterDiscord/BetterDiscord.git
cd betterdiscord
npm install -g pnpm
pnpm install
pnpm build
pnpm inject ptb
start "" "%START_MENU_PATH%"
)
set START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord PTB.lnk
taskkill /F /IM DiscordPTB.exe
if exist "%START_MENU_PATH%" (
cd betterdiscord
pnpm inject ptb
start "" "%START_MENU_PATH%"
)
set START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk
taskkill /F /IM Discord.exe
if exist "%START_MENU_PATH%" (
git clone https://github.com/BetterDiscord/BetterDiscord.git
cd betterdiscord
npm install -g pnpm
pnpm install
pnpm build
pnpm inject
start "" "%START_MENU_PATH%"
)
set START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk
taskkill /F /IM Discord.exe
if exist "%START_MENU_PATH%" (
cd betterdiscord
pnpm inject
start "" "%START_MENU_PATH%"
)
@doggeddalle
Copy link

Full reinstall edited for "Stable"

@echo off
REM ================================
REM BetterDiscord Full Installation
REM ================================

REM Define the path to the Discord shortcut in the Start Menu
set "START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk"

REM Stop Discord if it is running
echo Stopping Discord...
taskkill /F /IM Discord.exe >nul 2>&1

REM Ensure Discord is installed (via the Start Menu shortcut)
if exist "%START_MENU_PATH%" (
    REM Check if BetterDiscord folder exists
    if not exist "betterdiscord" (
        echo Cloning BetterDiscord repository...
        git clone https://github.com/BetterDiscord/BetterDiscord.git || (
            echo [Error] Git clone failed.
            pause
            exit /b 1
        )
    ) else (
        echo "betterdiscord" folder already exists. Updating repository...
        pushd betterdiscord
        git pull || (
            echo [Error] Git pull failed.
            pause
            popd
            exit /b 1
        )
        popd
    )

    REM Change directory into the repository folder
    pushd betterdiscord

    REM Check if pnpm is installed globally; if not, install it
    npm list -g pnpm >nul 2>&1
    if errorlevel 1 (
        echo Installing pnpm...
        npm install -g pnpm || (
            echo [Error] Failed to install pnpm.
            pause
            popd
            exit /b 1
        )
    ) else (
        echo pnpm is already installed.
    )

    echo Installing dependencies...
    pnpm install || (
        echo [Error] Dependency installation failed.
        pause
        popd
        exit /b 1
    )

    echo Building BetterDiscord...
    pnpm build || (
        echo [Error] Build failed.
        pause
        popd
        exit /b 1
    )

    echo Injecting BetterDiscord into Discord...
    pnpm inject || (
        echo [Error] Injection failed.
        pause
        popd
        exit /b 1
    )

    popd

    echo Starting Discord...
    start "" "%START_MENU_PATH%"
) else (
    echo Discord shortcut not found. Please ensure Discord is installed.
    pause
)

QuickReinstall edited for 'Stable'

@echo off
REM ================================
REM BetterDiscord Quick Reinstall
REM ================================

set "START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk"

echo Stopping Discord...
taskkill /F /IM Discord.exe >nul 2>&1

if exist "%START_MENU_PATH%" (
    if exist "betterdiscord" (
        pushd betterdiscord
        echo Re-injecting BetterDiscord...
        pnpm inject || (
            echo [Error] Injection failed.
            pause
            popd
            exit /b 1
        )
        popd
        echo Starting Discord...
        start "" "%START_MENU_PATH%"
    ) else (
        echo BetterDiscord folder not found. Please run the full installation script first.
        pause
    )
) else (
    echo Discord shortcut not found. Please ensure Discord is installed.
    pause
)

@Al-AmeenAdewunmi
Copy link

Full reinstall edited for "Stable"

@echo off
REM ================================
REM BetterDiscord Full Installation
REM ================================

REM Define the path to the Discord shortcut in the Start Menu
set "START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk"

REM Stop Discord if it is running
echo Stopping Discord...
taskkill /F /IM Discord.exe >nul 2>&1

REM Ensure Discord is installed (via the Start Menu shortcut)
if exist "%START_MENU_PATH%" (
    REM Check if BetterDiscord folder exists
    if not exist "betterdiscord" (
        echo Cloning BetterDiscord repository...
        git clone https://github.com/BetterDiscord/BetterDiscord.git || (
            echo [Error] Git clone failed.
            pause
            exit /b 1
        )
    ) else (
        echo "betterdiscord" folder already exists. Updating repository...
        pushd betterdiscord
        git pull || (
            echo [Error] Git pull failed.
            pause
            popd
            exit /b 1
        )
        popd
    )

    REM Change directory into the repository folder
    pushd betterdiscord

    REM Check if pnpm is installed globally; if not, install it
    npm list -g pnpm >nul 2>&1
    if errorlevel 1 (
        echo Installing pnpm...
        npm install -g pnpm || (
            echo [Error] Failed to install pnpm.
            pause
            popd
            exit /b 1
        )
    ) else (
        echo pnpm is already installed.
    )

    echo Installing dependencies...
    pnpm install || (
        echo [Error] Dependency installation failed.
        pause
        popd
        exit /b 1
    )

    echo Building BetterDiscord...
    pnpm build || (
        echo [Error] Build failed.
        pause
        popd
        exit /b 1
    )

    echo Injecting BetterDiscord into Discord...
    pnpm inject || (
        echo [Error] Injection failed.
        pause
        popd
        exit /b 1
    )

    popd

    echo Starting Discord...
    start "" "%START_MENU_PATH%"
) else (
    echo Discord shortcut not found. Please ensure Discord is installed.
    pause
)

QuickReinstall edited for 'Stable'

@echo off
REM ================================
REM BetterDiscord Quick Reinstall
REM ================================

set "START_MENU_PATH=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord.lnk"

echo Stopping Discord...
taskkill /F /IM Discord.exe >nul 2>&1

if exist "%START_MENU_PATH%" (
    if exist "betterdiscord" (
        pushd betterdiscord
        echo Re-injecting BetterDiscord...
        pnpm inject || (
            echo [Error] Injection failed.
            pause
            popd
            exit /b 1
        )
        popd
        echo Starting Discord...
        start "" "%START_MENU_PATH%"
    ) else (
        echo BetterDiscord folder not found. Please run the full installation script first.
        pause
    )
) else (
    echo Discord shortcut not found. Please ensure Discord is installed.
    pause
)

Yeah idk why, but every time I use this, the plugin ChannelTabs stops working and I'm forced to use the regular BD installer anyway.

@misterpyrrhuloxia
Copy link

Yeah idk why, but every time I use this, the plugin ChannelTabs stops working and I'm forced to use the regular BD installer anyway.

Same here—I have issues with some plugins not working at all by using the fullreinstall.

@doggeddalle
Copy link

Yeah idk why, but every time I use this, the plugin ChannelTabs stops working and I'm forced to use the regular BD installer anyway.

Same here—I have issues with some plugins not working at all by using the fullreinstall.

just use chatgpt to "tweak" script. the hard work is already there, run the fullinstall once, and subsequent times after discord forces shitupdate run the quickreinstall

@doggeddalle
Copy link

Yeah idk why, but every time I use this, the plugin ChannelTabs stops working and I'm forced to use the regular BD installer anyway.

possibly related to your windows setup, I have tested those edits on multiple people's computers and it does work. If you are not using Stable then you will face errors, but if you are using Stable then there is something else happening on your end.

@speedlorenzo12
Copy link

speedlorenzo12 commented Apr 23, 2025

It seems that this script (also the last one) wants to install from the developing branch but instead it should download from the main branch and a way to update the betterdiscord folder would be needed

@speedlorenzo12
Copy link

Wouldn't it be much faster to replace the files in the client's resources instead of installing betterdiscord entirely?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment