清除垃圾的VBS文件 自動查找多個盤
來源:易賢網(wǎng) 閱讀:1536 次 日期:2016-07-18 14:57:44
溫馨提示:易賢網(wǎng)小編為您整理了“清除垃圾的VBS文件 自動查找多個盤”,方便廣大網(wǎng)友查閱!

可以刪除.tmp ._mp .log .gid .chk .old file文件和 temp,recent,cookis,recycled,prefetch,and "Temporary Internet Files"文件夾。

代碼如下:

rem made by correy

rem made at 2007.9.22

rem it can be delete you computer's the follow things(except cd,dvd)

rem it can be delete empty file and folder

rem it can be delete .tmp ._mp .log .gid .chk .old file

rem 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 name's file and folder

On Error GoTo 0

Set fso = CreateObject("Scripting"&"."&"FileSystem"&"Object")

for n = 1 to 3

For Each d in fso.Drives

if d.drivetype=4 then

Exit For

else

scan(d)

end if

next

next

sub scan(folder)

on error resume next

set folder=fso.getfolder(folder)

for each file in folder.files

if file.size=0 then

file.delete(true)

end if

ext=fso.GetExtensionName(file)

ext=lcase(ext)

if ext="tmp" or ext="_mp" or ext="log" or ext="gid" or ext="chk" or ext="old" then ''30

file.delete(true)

end if

next

for each subfolder in folder.subfolders

rem instrRev() can't be used,i want to find "\".

if left(subfolder.path,4)="temp" or left(subfolder.path,8)="recycled" then

subfolder.delete(true)

elseif left(subfolder.path,6)="recent" or left(subfolder.path,7)="cookis" then

subfolder.delete(true) rem 40

elseif left(subfolder.path,24)="Temporary Internet Files" or left(subfolder.path,8)="prefetch" then

subfolder.delete(true)

end if

if subfolder.size=0 then subfolder.delete(true)

scan(subfolder)

next

end sub

更多信息請查看腳本欄目
易賢網(wǎng)手機網(wǎng)站地址:清除垃圾的VBS文件 自動查找多個盤
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

2025國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機號
  • 驗證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報警專用圖標(biāo)