@echo off
title Enable SMB1 + Insecure Guest Auth (Windows 10/11)
color 0A

echo ==========================================
echo   ENABLING SMB1 + INSECURE GUEST SMB
echo ==========================================
echo.

:: Check Admin
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo [ERROR] Run this script as Administrator!
    pause
    exit /b
)

echo [1/3] Enabling Insecure Guest Logons...
reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" ^
/v AllowInsecureGuestAuth /t REG_DWORD /d 1 /f

echo Done.
echo.

echo [2/3] Enabling SMB1 Client...
dism /online /Enable-Feature /FeatureName:SMB1Protocol-Client /All /NoRestart

echo.

echo [3/3] Enabling SMB1 Server (optional)...
dism /online /Enable-Feature /FeatureName:SMB1Protocol-Server /All /NoRestart

echo.
echo ==========================================
echo DONE! PLEASE RESTART YOUR PC
echo ==========================================
pause