试试这个- rem 启用来宾登录访问网上邻居
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "forceguest" /t REG_DWORD /d 0x1
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "everyoneincludesanonymous" /t REG_DWORD /d 0x1
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "LimitBlankPasswordUse" /t REG_DWORD /d 0x0
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "restrictanonymoussam" /t REG_DWORD /d 0x0
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa" /f /v "NoLmHash" /t REG_DWORD /d 0x0
- reg add "HKLM\SYSTEM\ControlSet001\Control\Lsa\MSV1_0" /f /v "LmCompatibilityLevel" /t REG_DWORD /d 0x1
- reg add "HKLM\SYSTEM\ControlSet001\Services\LanmanWorkstation\Parameters" /f /v "AllowInsecureGuestAuth" /t REG_DWORD /d 0x1
- reg add "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v "restrictnullsessaccess" /t REG_DWORD /d 0x0
-
- rem 启用“Computer Browser”服务
- reg add "HKLM\SYSTEM\ControlSet001\Services\Netman" /f /v "Start" /t REG_DWORD /d 0x2
- reg add "HKLM\SYSTEM\ControlSet001\Services\SSDPSRV" /f /v "Start" /t REG_DWORD /d 0x2
- reg add "HKLM\SYSTEM\ControlSet001\Services\SharedAccess" /f /v "Start" /t REG_DWORD /d 0x2
- reg add "HKLM\SYSTEM\ControlSet001\Services\lmhosts" /f /v "Start" /t REG_DWORD /d 0x2
- reg delete "HKLM\SYSTEM\ControlSet001\Services\NetBT\Parameters" /f /v "SMBDeviceEnabled"
- reg delete "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v "SMB1"
- reg delete "HKLM\SYSTEM\ControlSet001\Services\LanmanServer\Parameters" /f /v "SMB2"
- reg add "HKLM\SYSTEM\ControlSet001\Services\netprofm" /f /v "Start" /t REG_DWORD /d 0x2
- reg add "HKLM\SYSTEM\ControlSet001\Services\fdPHost" /f /v "Start" /t REG_DWORD /d 0x2
- reg add "HKLM\SYSTEM\ControlSet001\Services\FDResPub" /f /v "Start" /t REG_DWORD /d 0x2
- reg add "HKLM\SYSTEM\ControlSet001\Services\WMPNetworkSvc" /f /v "Start" /t REG_DWORD /d 0x2
-
- rem 添加防火墙规则
- >nul 2>&1 netsh advfirewall firewall set rule group=\"网络发现\" new enable=Yes
- >nul 2>&1 netsh advfirewall firewall set rule group=\"文件和打印机共享\" new enable=Yes
- >nul 2>&1 net config server /hidden:no
- rem 修改本地安全策略中的:拒绝从网络访问计算机,将里面的Guest删除
- set "_tf=%temp%\%~n0.inf"
- >"%_tf%" (echo.[Unicode]
- echo.Unicode=yes
- echo.[Version]
- echo.signature="$CHICAGO$"
- echo.Revision=1
- echo.[Privilege Rights]
- echo.sedenynetworklogonright =
- echo.senetworklogonright = Everyone,Administrators,Users,Power Users,Backup Operators,guest)
- if not exist "%_tf%" goto:eof
- >nul 2>&1 secedit /configure /db "%_tf:inf=sdb%" /cfg "%_tf%" /log "%_tf:inf=log%" /quiet
- >nul 2>&1 del /q "%_tf:inf=*%"
复制代码
|