Windows NT/2000 系统默认共享清除工具 (批处理文件)
Windows NT/2000 系统默认共享清除工具 (批处理文件) Windows NT/2000 系统默认共享清除工具
作者:阿新(Seraph Chutium)
主页:http://com.6to23.com/
================================================================================
使用方法:
例如,删除系统默认共享:
delshare c d e ipc admin print
若本地硬盘盘符不是 C: D: E: ,请自行修改
如:
本地硬盘为 C: D: E: X: Y: Z: ,则应改为:
delshare c d e x y z ipc admin print
*** 支持可同时删除 9 个共享目录 ***
================================================================================
手动清除的简单总结:
使用 Windows NT/2000 的管理工具poledit.exe(系统策略配置器),选择 打开注册表 -> 本地计算机 -> Windows NT 网络 -> 共享 -> 将其中的两个选项取消。
以上方法实际还是用的修改注册表,实际清除过程在我做的delshare.bat实现过程如下:
echo 修改注册表项,修改系统默认共享属性
echo.
echo 生成 delshare.reg 准备修改注册表
echo Windows Registry Editor Version 5.00> c:\delshare.reg
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
echo 运行 delshare.reg 修改注册表
regedit /s c:\delshare.reg
echo 删除 delshare.reg 临时文件
del c:\delshare.reg
================================================================================
另外做了一个在英文 Windows NT/2000 下使用的 delsharen.bat ,清除方法和中文版的相同,只是更改了运行的语言环境。
英文版全部代码如下:
---====== http://chutium.top263.net/software/delsharen.bat =====---
@echo off
:Rem Check Parameters
if {%1}=={} goto :Usage
:Rem Main
echo.
echo ------------------------------------------------------
echo.
echo Delete share drivers
echo.
net share %1$ /delete
net share %2$ /delete
net share %3$ /delete
net share %4$ /delete
net share %5$ /delete
net share %6$ /delete
net share %7$ /delete
net share %8$ /delete
net share %9$ /delete
net stop Server
net start Server
echo.
echo Share drivers has been deleted completely.
echo.
echo ------------------------------------------------------
echo.
echo Edit registry
echo.
echo MAKE delshare.reg for edit registry
echo Windows Registry Editor Version 5.00> c:\delshare.reg
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
echo RUN delshare.reg to edit registry
regedit /s c:\delshare.reg
echo DELETE temporary file: delshare.reg
del c:\delshare.reg
goto :END
:Usage
echo.
echo ------------------------------------------------------
echo.
echo Windows NT/2000 Default share drivers remove tools.
echo.
echo AUTHOR : Seraph Chutium
echo Homepage: http://com.6to23.com/
echo.
echo Error: Parameters False
echo.
echo *=*=* Please input parameters *=*=*
echo.
echo For example:
echo delshare c d e ipc admin print
echo.
echo If the local drivers is not C: D: E: , you mast change it
echo.
echo Give an example:
echo Local drivers is C: D: E: X: Y: Z:
echo delshare c d e x y z ipc admin print
echo.
echo *** It only can delete nine shares at one time ***
echo.
echo ------------------------------------------------------
goto :EOF
:END
echo.
echo ------------------------------------------------------
echo.
echo Windows NT/2000 Default share drivers removed completely.
echo.
echo AUTHOR : Seraph Chutium
echo Homepage: http://com.6to23.com/
echo.
echo ------------------------------------------------------
echo.
:EOF
---====== http://chutium.top263.net/software/delsharen.bat =====---
------------------------------------------------------------------------------------
阿新 - Seraph Chutium
http://com.6to23.com/
http://www.cnhack.org/