@echo off setlocal EnableExtensions title Fix Windows SMB Guest Access echo ============================================ echo FIX SMB GUEST ACCESS - WINDOWS echo ============================================ echo. :: Check Administrator net session >nul 2>&1 if not "%errorlevel%"=="0" ( echo [ERROR] Please run this BAT file as Administrator. echo. pause exit /b 1 ) echo [1/6] Enable insecure SMB Guest Logon... powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Set-SmbClientConfiguration -EnableInsecureGuestLogons $true -Force" if errorlevel 1 ( echo [WARNING] PowerShell Set-SmbClientConfiguration failed. ) echo. echo [2/6] Set Windows LanmanWorkstation Guest Policy... reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" /v AllowInsecureGuestAuth /t REG_DWORD /d 1 /f echo. echo [3/6] Make sure SMB Signing is not required... powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Set-SmbClientConfiguration -RequireSecuritySignature $false -Force" if errorlevel 1 ( echo [WARNING] Could not change SMB signing setting. ) echo. echo [4/6] Refresh Group Policy... gpupdate /force echo. echo [5/6] Display current SMB Client settings... powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Get-SmbClientConfiguration | Select-Object EnableInsecureGuestLogons,RequireSecuritySignature" echo. echo [6/6] Remove existing SMB connections... net use * /delete /y echo. echo ============================================ echo IMPORTANT echo ============================================ echo After this script finishes, RESTART Windows. echo. echo Then test: echo \\192.168.1.17 echo. echo If it still asks for Administrator/password, echo run the diagnostic commands below. echo. echo powershell -NoProfile -Command "Get-SmbClientConfiguration ^| Select EnableInsecureGuestLogons,RequireSecuritySignature" echo reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" /v AllowInsecureGuestAuth echo net view \\192.168.1.17 echo. choice /M "Restart Windows now" if errorlevel 2 ( echo. echo Please restart Windows manually before testing. pause exit /b 0 ) shutdown /r /t 5 /c "Restarting Windows after SMB Guest configuration" exit /b 0