@echo off :: ============================================================ :: Enable WebDAV Basic Auth over HTTP (non-SSL) on Windows :: Must be run as Administrator :: ============================================================ :: --- Check for admin rights --- net session >nul 2>&1 if %errorLevel% NEQ 0 ( echo [ERROR] This script must be run as Administrator. echo Right-click the file and choose "Run as administrator". pause exit /b 1 ) echo ============================================================ echo Setting BasicAuthLevel registry key... echo ============================================================ reg add "HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters" ^ /v BasicAuthLevel /t REG_DWORD /d 2 /f if %errorLevel% NEQ 0 ( echo [ERROR] Failed to set registry key. pause exit /b 1 ) echo. echo Registry key set successfully. echo. echo ============================================================ echo Restarting WebClient service... echo ============================================================ net stop WebClient net start WebClient if %errorLevel% NEQ 0 ( echo [WARNING] Service restart may have failed. Check manually echo via services.msc if the WebClient service is running. ) else ( echo. echo WebClient service restarted successfully. ) echo. echo ============================================================ echo Done. You can now try mapping the WebDAV drive again. echo ============================================================ pause