can you make it so the script ends at the end: @echo off setlocal color 0f TITLE Discord…
- User
can you make it so the script ends at the end: @echo off setlocal color 0f TITLE Discord Debloat mode con cols=80 lines=25 chcp 65001 >nul
CALL :LOGO
:LOGO echo ██████╗ ██╗███████╗ ██████╗ ██████╗ ██████╗ ██████╗
echo ██╔══██╗██║██╔════╝██╔════╝██╔═══██╗██╔══██╗██╔══██╗
echo ██║ ██║██║███████╗██║ ██║ ██║██████╔╝██║ ██║
echo ██║ ██║██║╚════██║██║ ██║ ██║██╔══██╗██║ ██║
echo ██████╔╝██║███████║╚██████╗╚██████╔╝██║ ██║██████╔╝
echo ╚═════╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝
echo.
echo ██████╗ ███████╗██████╗ ██╗ ██████╗ █████╗ ████████╗ echo ██╔══██╗██╔════╝██╔══██╗██║ ██╔═══██╗██╔══██╗╚══██╔══╝ echo ██║ ██║█████╗ ██████╔╝██║ ██║ ██║███████║ ██║
echo ██║ ██║██╔══╝ ██╔══██╗██║ ██║ ██║██╔══██║ ██║
echo ██████╔╝███████╗██████╔╝███████╗╚██████╔╝██║ ██║ ██║
echo ╚═════╝ ╚══════╝╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
echo.
pausesetlocal enabledelayedexpansion
REM Set Variables set "localesDir=" set "DISCORD_PATH=" set "MODULES_DIR="
REM Find the Discord installation directory for /d %%D in ("%LOCALAPPDATA%\Discord\app-*") do ( set "DISCORD_PATH=%%D\Discord.exe" set "localesDir=%%D\locales" set "MODULES_DIR=%%D\modules" )
REM Check if Discord was found if not exist "%DISCORD_PATH%" ( echo Discord is not installed. pause exit /b )
REM Close Discord taskkill /F /IM Discord.exe >nul 2>&1
REM Clear Discord Cache echo -Discord Cache Cleared rd /s /q "%APPDATA%\Discord\Cache" >NUL 2>&1 rd /s /q "%APPDATA%\Discord\Code Cache" >NUL 2>&1 rd /s /q "%APPDATA%\Discord\Crashpad" >NUL 2>&1 rd /s /q "%APPDATA%\Discord\GPUCache" >NUL 2>&1 rd /s /q "%APPDATA%\Discord\shared_proto_db" >NUL 2>&1
REM Debloat Modules Folder echo -Modules Folder Debloated for /L %%i in (1,1,5) do ( for %%f in (cloudsync dispatch erlpack game_utils krisp modules overlay2 spellcheck zstd) do ( set "folderPath=%MODULES_DIR%\discord_%%f-%%i" echo Checking for "%folderPath%" >NUL 2>&1 if exist "!folderPath!" ( rd /s /q "!folderPath!" ) ) )
REM Debloat Languages Folder echo -Locales Folder Debloated cd /d "%localesDir%" for %%f in (*.pak) do ( if /I not "%%~nf"=="en-US" if /I not "%%~nf"=="en-GB" ( echo Deleting %%f del "%%f" >NUL 2>&1 ) )
REM Delete Specific Unwanted Files echo -Specific Unwanted Files Deleted cd /d "%HOMEPATH%\Desktop" del /f Discord.ink*., Discord.exe., Update.exe.* >NUL 2>&1
cd /d "%LOCALAPPDATA%\Discord" del /f Discord*., Squirrel., Update.* >NUL 2>&1
cd /d "%LOCALAPPDATA%\Discord\app-" del /f chrome_1., chrome_2., crash., d3d., debug.log, libegl.dll, libgle....* >NUL 2>&1
- Assistant
To ensure that the batch script exits when it reaches the end, you can include an
exitstatement at the end. This will explicitly tell the script to terminate, thereby preventing it from running any further commands. Here's how you can do it:batch... echo Discord Debloat Completed. echo. pause REM Exit the script exitThis
exitcommand will close the batch script once the final pause is completed after the "Discord Debloat Completed" message. This ensures that the script ends where you intend it to.