CODE: [Copy to clipboard]
:: Disable Simple Sharing
%SystemRoot%\System32\REG add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\SimpleSharing" /f /v "DefaultValue" /t REG_DWORD /d 0
:: Configure netshare
%SystemRoot%\System32\REG add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /f /v "restrictanonymous" /t REG_DWORD /d 0
%SystemRoot%\System32\REG add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /f /v "restrictanonymoussam" /t REG_DWORD /d 1
%SystemRoot%\System32\REG add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /f /v "forceguest" /t REG_DWORD /d 0
%SystemRoot%\System32\REG add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /f /v "limitblankpassworduse" /t REG_DWORD /d 0
%SystemRoot%\System32\REG add "HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters" /f /v "autoshareserver" /t REG_DWORD /d 1
%SystemRoot%\System32\REG add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /f /v "AutoShareWks" /t REG_DWORD /d 1:: Make the changes effective immediately
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
%systemroot%\system32\sc.exe config SharedAccess start= DISABLED
%systemroot%\system32\sc.exe stop SharedAccess
%systemroot%\system32\sc.exe config lanmanserver start= AUTO
%systemroot%\system32\sc.exe start lanmanserver
%systemroot%\system32\sc.exe config lanmanworkstation start= AUTO
%systemroot%\system32\sc.exe start lanmanworkstation
这段代码将默认的xp强制使用guest网络访问改为使用本地登录模式,另外禁用了简单共享,满足psexec的基本条件,对网管来说网吧局域网环境可以忽略安全问题,考虑方便性为主.