what's the difference between this script:
@echo off
setlocal
TITLE Discord Debloat
setlocal 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
REM Clear Discord Cache
echo Clearing Discord Cache.
rd /s /q "%APPDATA%\Discord\Cache"
rd /s /q "%APPDATA%\Discord\Code Cache"
rd /s /q "%APPDATA%\Discord\Crashpad"
rd /s /q "%APPDATA%\Discord\GPUCache"
rd /s /q "%APPDATA%\Discord\shared_proto_db"
REM Debloat Modules Folder
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%"
if exist "!folderPath!" (
rd /s /q "!folderPath!"
)
)
)
REM Debloat Languages Folder
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"
)
)
REM Add High-DPI Registry Key Discord
REM Create the registry key for Discord DPI settings
REG ADD "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "%DISCORD_PATH%" /t REG_SZ /d "HIGHDPIAWARE" /f
echo Discord Debloat Completed.
pause
exit /b
and this script:
@echo off
setlocal
TITLE Discord Debloat
echo Starting Discord Debloat Script…
setlocal 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
echo Attempting to close Discord…
taskkill /F /IM Discord.exe >nul 2>&1
REM Clear Discord Cache
echo Clearing Discord cache…
for %%D in (Cache “Code Cache” Crashpad GPUCache shared_proto_db) do (
if exist “%APPDATA%\Discord%%D” (
rd /s /q “%APPDATA%\Discord%%D”
echo Deleted: %%D
) else (
echo Not Found: %%D
)
)
REM Debloat Modules Folder
echo Debloating Discord modules…
if exist “%MODULES_DIR%” (
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”
if exist “!folderPath!” (
rd /s /q “!folderPath!”
echo Deleted: !folderPath!
)
)
)
) else (
echo Modules directory not found.
)
REM Debloat Languages Folder
echo Debloating language files…
if exist “%localesDir%” (
cd /d “%localesDir%”
for %%f in (.pak) do (
if /I not “%%~nf”==“en-US” if /I not “%%~nf”==“en-GB” (
del “%%f”
echo Deleted: %%f
)
)
) else (
echo Locales directory not found.
)