@echo off
set "TARGET_DIR=%LOCALAPPDATA%\Musys"

:: Check if directory exists
if not exist "%TARGET_DIR%" (
    echo [Error] Cannot find directory: %TARGET_DIR%
    pause
    exit /b
)

echo Cleaning in progress, please wait...

:: Force delete files and subdirectories, skip errors
del /f /s /q "%TARGET_DIR%\*" 2>nul
for /d %%p in ("%TARGET_DIR%\*") do (
    rd /s /q "%%p" 2>nul
)

:: Clear the screen and show final message
cls
echo ========================================
echo        Cleaning task completed!
echo ========================================
echo.
pause