批处理教程6——精彩实例放送
来源:互联网 发布:网络电视频道大表 编辑:程序博客网 时间:2024/06/06 08:40
六.精彩实例放送。
1.删除win2k/xp系统默认共享的批处理
------------------------ cut here then save as .bat or .cmd file ---------------------------
@echo preparing to delete all the default shares.when ready pres any key.
@pause
@echo off
:Rem check parameters if null show usage.
if {%1}=={} goto :Usage
:Rem code start.
echo.
echo ------------------------------------------------------
echo.
echo Now deleting all the default shares.
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 All the shares have been deleteed
echo.
echo ------------------------------------------------------
echo.
echo Now modify the registry to change the system default properties.
echo.
echo Now creating the registry file
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 Nowing using the registry file to chang the system default properties.
regedit /s c:/delshare.reg
echo Deleting the temprotarily files.
del c:/delshare.reg
goto :END
:Usage
echo.
echo ------------------------------------------------------
echo.
echo ☆ A example for batch file ☆
echo ☆ [Use batch file to change the sysytem share properties.] ☆
echo.
echo Author:Ex4rch
echo Mail:Ex4rch@hotmail.com QQ:1672602
echo.
echo Error:Not enough parameters
echo.
echo ☆ Please enter the share disk you wanna delete ☆
echo.
echo For instance,to delete the default shares:
echo delshare c d e ipc admin print
echo.
echo If the disklable is not as C: D: E: ,Please chang it youself.
echo.
echo example:
echo If locak disklable are C: D: E: X: Y: Z: ,you should chang the command into :
echo delshare c d e x y z ipc admin print
echo.
echo *** you can delete nine shares once in a useing ***
echo.
echo ------------------------------------------------------
goto :EOF
:END
echo.
echo ------------------------------------------------------
echo.
echo OK,delshare.bat has deleted all the share you assigned.
echo.Any questions ,feel free to mail to Ex4rch@hotmail.com.
echo
echo.
echo ------------------------------------------------------
echo.
:EOF
echo end of the batch file
------------------------ cut here then save as .bat or .cmd file ---------------------------
2.全面加固系统(给肉鸡打补丁)的批处理文件
------------------------ cut here then save as .bat or .cmd file ---------------------------
@echo Windows Registry Editor Version 5.00 >patch.dll
@echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/lanmanserver/parameters] >>patch.dll
@echo "AutoShareServer"=dword:00000000 >>patch.dll
@echo "AutoShareWks"=dword:00000000 >>patch.dll
@REM [禁止共享]
@echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa] >>patch.dll
@echo "restrictanonymous"=dword:00000001 >>patch.dll
@REM [禁止匿名登录]
@echo [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/NetBT/Parameters] >>patch.dll
@echo "SMBDeviceEnabled"=dword:00000000 >>patch.dll
@REM [禁止及文件访问和打印共享]
- 批处理教程6——精彩实例放送
- 【孟宪会之精彩世界】DHtml精彩放送
- 精彩实例详解CSS滤镜教程
- 批处理文件制作实例精彩教程2
- 40+精彩的HTML5实例和教程
- 40+精彩的HTML5实例和教程
- 批处理教程1——简单批处理内部命令简介
- CCF TF干货放送&精彩瞬间
- CNUTCon福利大放送&精彩回顾
- 多用,精彩批处理代码
- 韩国美女BOA(宝儿)精彩MTV大放送
- 批处理命令学习笔记——简单的批处理应用实例
- 批处理实例
- 批处理实例
- 批处理实例
- 批处理实例
- 批处理教程3——如何使用组合命令
- 批处理教程4——管道命令的使用
- MM-安全库存{转载}
- 在线播放器的使用
- 批处理教程5——如何用批处理文件来操作注册表
- 在Flex中用Iframe嵌入HTML网页
- mobile6 电池驱动分析
- 批处理教程6——精彩实例放送
- 批处理教程7——致谢&一些废话
- Spring框架:项目名称起源
- c# hashtable 遍历
- AT91SAM9263 WINCE 6.0 R2驱动开发-扩展4个串口芯片SC16C554驱动
- 在sql server 2005里,根据数据库性能动态构建索引。
- 学英语也能学成哲学家!
- tar命令详解
- java 调用命令 备份mysql数据库