Red Maple Leaf's
@ ECHO OFF
color 1b
title Enable LAN Sharing
@ ECHO.
@ ECHO. Instructions
@ ECHO --------------------------------------------------------------------
@ ECHO After executing this batch processing, the following settings will be made:
@ ECHO 1. Allow anonymous enumeration of SAM accounts and shares
@ ECHO 2. If the local account has an empty password, allow other machines to access this machine.
@ ECHO 3. Windows Firewall: Allow file and printer sharing.
@ ECHO 4. Sharing method: Local users authenticate as guests.
@ ECHO 5. Guest account: Enable.
@ ECHO.
@ ECHO With this sharing method, other machines can access this machine without entering a username or password. For example, in a home LAN where everyone is trustworthy, use this method.
@ ECHO.
@ ECHO No matter which sharing method is used, sharing is only for internal use. In the case of using a router to access the Internet, the external network cannot access your machine, so there is no need to worry about being invaded if sharing is enabled. You only need to remember that when dialing up alone, do not enable sharing.
@ ECHO --------------------------------------------------------------------
for /l %%i in (1,1,10000) do @echo %%i>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa /v "restrictanonymous" /t REG_DWORD /d 0x00000000 /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa /v "restrictanonymous" /t REG_DWORD /d 0x00000000 /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa /v "limitblankpassworduse" /t REG_DWORD /d 0x00000000 /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa /v "limitblankpassworduse" /t REG_DWORD /d 0x00000000 /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v "445:TCP" /d "445:TCP:LocalSubNet:Enabled:@xpsp2res.dll,-22005" /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v "137:UDP" /d "137:UDP:LocalSubNet:Enabled:@xpsp2res.dll,-22001" /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v "138:UDP" /d "138:UDP:LocalSubNet:Enabled:@xpsp2res.dll,-22002" /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v "139:TCP" /d "139:TCP:LocalSubNet:Enabled:@xpsp2res.dll,-22004" /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Epoch /v "Epoch" /t REG_DWORD /d 0x000001ED /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Print\Providers /v "LogonTime" /t REG_BINARY /d E8318E4F6495C601 /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v "445:TCP" /d "445:TCP:LocalSubNet:Enabled:@xpsp2res.dll,-22005" /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v "137:UDP" /d "137:UDP:LocalSubNet:Enabled:@xpsp2res.dll,-22001" /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v "138:UDP" /d "138:UDP:LocalSubNet:Enabled:@xpsp2res.dll,-22002" /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\GloballyOpenPorts\List /v "139:TCP" /d "139:TCP:LocalSubNet:Enabled:@xpsp2res.dll,-22004" /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Epoch /v "Epoch" /t REG_DWORD /d 0x000001ED /F>nul
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa /v "forceguest" /t REG_DWORD /d 0x00000001 /F>nul
cls
@ ECHO.
@ ECHO --------------------------------------------------------------------
@ ECHO Operation completed.
@ ECHO Note: It will take effect after this machine restarts.
@ ECHO.
@ ECHO --------------------------------------------------------------------
@ ECHO.
@ ECHO Supplementary questions and answers:
@ ECHO If the previous sharing method was "Local users authenticate as themselves" when sharing a folder,
@ ECHO then when switching to authenticating as a guest and then accessing that folder, an error will pop up: Cannot access, you do not have permission to use the network resource. The solution is to cancel the original sharing properties of that folder, and then share it again.
@ ECHO --------------------------------------------------------------------
for /l %%i in (1,1,10000) do @echo %%i>nul
[ Last edited by afeichai on 2007-11-12 at 09:09 AM ]