echo offchcp 65001 nulsetlocal EnableDelayedExpansion:: 自检管理员权限非管理员则自动提权 net session nul 21if %errorlevel% neq 0 (echo 正在请求管理员权限...powershell -NoProfile -Command Start-Process -FilePath %~f0 -Verb RunAsexit /b)echo echo 1/3 启用不安全的 Guest 登录 (Enable insecure guest logons)echo reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation /v AllowInsecureGuestAuth /t REG_DWORD /d 1 /fecho.echo echo 2/3 启用 Windows 功能 SMB 1.0echo dism /online /enable-feature /featurename:SMB1Protocol /all /norestartecho.echo echo 3/3 禁用 SMB 通信数字签名echo echo [客户端] 数字签名通信始终reg add HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters /v RequireSecuritySignature /t REG_DWORD /d 0 /fecho [客户端] 数字签名通信如果服务器同意reg add HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters /v EnableSecuritySignature /t REG_DWORD /d 0 /fecho [服务器] 数字签名通信始终reg add HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters /v RequireSecuritySignature /t REG_DWORD /d 0 /fecho [服务器] 数字签名通信如果客户端同意reg add HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters /v EnableSecuritySignature /t REG_DWORD /d 0 /fecho.echo echo 刷新组策略并重启 SMB 相关服务echo gpupdate /target:computer /forcenet stop LanmanWorkstation /y nul 21net stop LanmanServer /y nul 21net start LanmanServer nul 21net start LanmanWorkstation nul 21echo.echo 全部完成建议重启计算机使 SMB 1.0 生效。echo pause
