- @echo off
- echo 开始删除每个分区下的默认共享.
- for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ( if exist %%a:\nul (net share %%a$ /delete>nul 2>nul ) )
- net share admin$ /delete>nul 2>nul
- net stop Server /y>nul 2>nul
- net start Server>nul 2>nul
- echo 修改注册表以更改系统默认设置.
- echo Windows Registry Editor Version 5.00> c:\delshare.reg
- :: 通过注册表禁止Admin$共享,以防重启后再次加载
- echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters]>> c:\delshare.reg
- echo "AutoShareWks"=dword:00000000>> c:\delshare.reg
- echo "AutoShareServer"=dword:00000000>> c:\delshare.reg
- :: 删除IPC$共享,本功能需要administritor权限才能成功删除
- echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]>> c:\delshare.reg
- echo "restrictanonymous"=dword:00000001>> c:\delshare.reg
- echo 正在导入注册表文件以更改系统默认设置.
- regedit /s c:\delshare.reg
- del c:\delshare.reg && echo 临时文件已经删除.
- pause>nul
复制代码 请问:删除默认共享后为何要重启server?
[ 本帖最后由 curious 于 2009-6-1 18:13 编辑 ] |