《清除垃圾的VBS文件自动查找多个盘》由会员分享,可在线阅读,更多相关《清除垃圾的VBS文件自动查找多个盘(2页珍藏版)》请在金锄头文库上搜索。
1、可以删除.tmp ._mp .log .gid .chk .old file 文件和 temp,recent,cookis,recycled,prefetch,and Temporary Internet Files文件夹。代码如下:rem made by correyrem made at 2007.9.22rem it can be delete you computers the follow things(except cd,dvd)rem it can be delete empty file and folderrem it can be delete .tmp ._mp .log
2、 .gid .chk .old filerem it can be delete temp,recent,cookis,recycled,prefetch,and Temporary Internet Files folder.rem i am thinking how to delete the same size and same names file and folderOn Error GoTo 0Set fso = CreateObject(Scripting&.&FileSystem&Object)for n = 1 to 3For Each d in fs
3、o.Drivesif d.drivetype=4 thenExit Forelsescan(d)end ifnextnextsub scan(folder)on error resume nextset folder=fso.getfolder(folder)for each file in folder.filesif file.size=0 thenfile.delete(true)end ifext=fso.GetExtensionName(file)ext=lcase(ext)if ext=tmp or ext=_mp or ext=log or ext=gid or ext=chk
4、or ext=old then 30file.delete(true)end ifnextfor each subfolder in folder.subfoldersrem instrRev() cant be used,i want to find ”.if left(subfolder.path,4)=temp or left(subfolder.path,8)=recycled thensubfolder.delete(true)elseif left(subfolder.path,6)=recent or left(subfolder.path,7)=cookis thensubfolder.delete(true) rem 40elseif left(subfolder.path,24)=Temporary Internet Files or left(subfolder.path,8)=prefetchthensubfolder.delete(true)end ifif subfolder.size=0 then subfolder.delete(true) scan(subfolder)nextend sub