bat 批处理自动清除及删除windows默认共享盘符

来源:未知 责任编辑:责任编辑 发表时间:2015-01-01 13:18 点击:

Windows在默认情况下几个盘多是共享的,它们是隐藏的危险。
在dos下用命令“net share”可以查看。。。
不能截图,就只能打打字了
@echo off 
echo 正在自动删除admin$管理共享和ipc$管道共享,
net share admin$ /del
net share IPC$ /del
net share C$ /del
net share D$ /del
net share E$ /del
net share F$ /del

@echo off并不是DOS程序中的,
而是DOS批处理中的。
当年的DOS,所有操作都用键盘命令来完成,
当你每次都要输入相同的命令时,
可以把这么多命令存为一个批处理。
上面那段是默认admin$管理共享和ipc$管道共享的命令
如果那没有这么多盘符,可以照上面的“net shere  *$” /del ’   *是你的盘符号。进行增减

 

@echo off
echo   这是正在检查cookies、历史纪录等目录位置(当前用户)……
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v Cache>%temp%cleantmp.txt
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v Cookies>>%temp%cleantmp.txt
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v History>>%temp%cleantmp.txt
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v NetHood>>%temp%cleantmp.txt
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v Recent>>%temp%cleantmp.txt

echo  这里是 清理当前用户的Cookies,IE缓存,历史纪录等……
for /f "tokens=3*" %%i in (%temp%cleantmp.txt) do (
for /d %%i in ("%%i %%b*.*") do rd /q /s "%%i">Nul 2>Nul
del /a /f /s /q "%%i %%b*.*">Nul 2>Nul
)

echo  这里清理系统临时垃圾文件……
del /a /f /s /q "%userprofile%Locals~1Tempor~1*.*" >Nul 2>Nul
del /a /f /s /q "%userprofile%Locals~1Temp*.*" >Nul 2>Nul
del /a /f /s /q "%userprofile%cookies*.*" >Nul 2>Nul
del /a /f /s /q "%userprofile%ecent*.*" >Nul 2>Nul
del /a /f /s /q "%Temp%*.*" >Nul 2>Nul
del /a /f /s /q "%Tmp%*.*" >Nul 2>Nul
del /a /f /s /q "%HomePath%..IconCache.db" >Nul 2>Nul
del /a /f /s /q "%SystemDrive%driver?*.pnf" >Nul 2>Nul
del /a /f /s /q "%SystemDrive%driver?InfCache.1" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%*._mp" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%*.bak" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%kb*.log" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%*.dmp" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%*.gid" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%*.old" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%*.query" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%*.tmp" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%infInfCache.1" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%driver?*.pnf" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%driver?InfCache.1" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%inf*.pnf" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%minidump*.*" >Nul 2>Nul
del /a /f /s /q "%SystemRoot%Prefetch*.*" >Nul 2>Nul
for %%i 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 del /a /f /q %%i:autorun.inf %%i:*.exe & rd /q /s %%i:ecycler %%i:ecycled

发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
用户名: 验证码:点击我更换图片
最新评论 更多>>

推荐热点

  • dos命令原来也能这样用?允许查找未知子目录指定文件
  •  windows的磁盘操作之八——格式化分区的思考
  • windows篇-第三章 安装和配置DNS服务器
  • windows篇-第二章 安装和配置Web服务器
  • windows篇-第一章 windows server 2008安装和简单配置
  •  windows server 2003断开远程之后自动注销用户
  • Windows服务器下用IIS Rewrite组件为IIS设置伪静态方法
  • Windows 2008 R2 SP1部署WSUS 3.0 SP2
  • Windows 7秘籍揭秘:用“手”写公式

快速直达

操作系统导航

LinuxWindows虚拟机
网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
Copyright © 2008-2015 计算机技术学习交流网. 版权所有

豫ICP备11007008号-1